Basically, I have a script that adds rounds into my game.
Script:
while true do
-- Intermission before the round starts
intermission(INTERMISSION_TIME) -- teleports players to lobby and waits INTERMISSION_TIME
print("Round starting!")
start() -- teleports players to map
repeat
wait(1)
until #game.Teams.Humans:GetPlayers() == 0 --wait until every player is on the zombie team
--wait until 0 humans are left, then repeat the loop
end
You could also try separate functions, and do a while loop for the start function and for the wait until no players left. you could try a while #game.Teams.Humans:GetPlayers() > 0 do
...
repeat print(#game.Teams.Humans:GetPlayers(), "players left.")
task.wait(1) --//Please use task library functions
until #game.Teams.Humans:GetPlayers() == 0 --wait until every player is on the zombie team
--wait until 0 humans are left, then repeat the loop
end
Okay, there you have it. Something is going wrong in your script that handles changing teams after dying/losing. Either look further into it yourself or share the script that handles said functions.
If you manually change your team to ‘Zombies’ and it continues without errors, then the script works.
If you want the game to change your team to ‘Zombies’ and the script still keeps repeating, then the fault lies in the script that handles the player’s team change. If you need further assistance, we need to see the script/portion that handles the player teams.