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; } } } -
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. -
Dragon115 You can use the method
isHost()to check if a player is the host.JezuzLizard Awesome thanks
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login