Hello guys,
I got this code:
The problem with this code is that it takes to long.
I want that this code is running for every player at the same time, that this code does is run it for every player one by one.
Is there a way to fix this?
I got this code:
code_language.skript:
command /startclassic1:
executable by: console and players
trigger:
loop all players:
if {classic::players::*} contains loop-player:
if {color::%loop-player%} is set:
set {_rol} to a random element out of {classic::rollen::*}
set {rol::%loop-player%} to {_rol}
remove {_rol} from {classic::rollen::*}
send "You are the %{_rol}%!" to loop-player
send "%loop-player% is %{_rol}%" to console
if {_rol} is "Godfather" or "Framer" or "Mafioso":
add loop-player to {classic::mafia::*}
send "&cClassic 1 Mafia: &f%{classic::mafia::*}%" to console
else if {_rol} is "Serial Killer":
add loop-player to {classic::evil::*}
send "&cClassic 1 Evil: &f%{classic::evil::*}%" to console
else if {_rol} is "Survivor":
add loop-player to {classic::neutral::*}
send "&cClassic 1 Neutral: &f%{classic::neutral::*}%" to console
else:
add loop-player to {classic::town::*}
send "&cClassic 1 Town: &f%{classic::town::*}%" to console
set {_countdown} to 10
wait 1 tick
send action bar from "Daytime: %{_countdown}%" to loop-player
loop 10 times:
remove 1 from {_countdown}
wait 1 second
send action bar from "Daytime: %{_countdown}%" to loop-player
wait a second
send action bar from "&b" to loop-player
set {classic.started} to true
set {classic.night} to true
The problem with this code is that it takes to long.
I want that this code is running for every player at the same time, that this code does is run it for every player one by one.
Is there a way to fix this?