Possible to make this script only for the host?
-
I created this script to change the bus speed but on coop its not synced between players. I don't know if it causes any conflicts when other players use it but I want to avoid that causing problems.
change_bus_speed() { print = 0; option = 0; if (getDvar ("ui_zm_mapstartlocation") == "transit") { flag_wait( "initial_blackscreen_passed" ); self iprintln("Press and Hold [{+actionslot 4}] to adjust Bus Speed"); wait 0.50; self iprintln("Speed options increase after power is turned on"); } if(level.scr_zm_map_start_location == "transit") { for(;;) { if ( self actionslotfourbuttonpressed() ) { wait 0.10; print += 1; option += 1; if ( !flag( "power_on" ) ) { if(print == 2) { print = 0; } if(option == 2) { option = 0; } if(print == 0) { self iprintln("Bus Speed: Default"); } } else { } if(print == 1) { self iprintln("Bus Speed: Slow"); } else if(print == 2) { self iprintln("Bus Speed: Fast"); } else if(print == 3) { self iprintln("Bus Speed: Super Fast"); } else if(print == 4) { self iprintln("Bus Speed: Default"); print = 0; } } if(option == 0) { } else if(option == 1) { foreach(d in level.the_bus.destinations) { d.busspeedleaving = 2500; } level.the_bus setvehmaxspeed(100); level.the_bus setspeed(2500, 1); level.the_bus.targetspeed = 2500; } else if(option == 2) { foreach(d in level.the_bus.destinations) { d.busspeedleaving = 2500; } level.the_bus setvehmaxspeed(2500); level.the_bus setspeed(2500, 2); level.the_bus.targetspeed = 2500; } else if(option == 3) { foreach(d in level.the_bus.destinations) { d.busspeedleaving = 2500; } level.the_bus setvehmaxspeed(2500); level.the_bus setspeed(2500, 3); level.the_bus.targetspeed = 2500; } else if(option == 4) { option = 0; } wait 0.05; } } }
-
Dragon115 You can use the method
isHost()
to check if a player is the host. -
JezuzLizard Awesome thanks