I am creating a round script for my game and I am stuck. I want to know how all players will return to the lobby after they are killed, but the round only restarts after one player is killed, and the time also freezes for other players that are still alive in the game/round. Why is this happening? I just want to get to the point of the script.
while true do
wait(1)
ftime = ftime - 1
text.Value = "Time: ".. ftime
Playing = workspace.Players:GetChildren()
if #Playing == 0 then
for _, v in pairs(workspace.MapFolder:GetChildren()) do
v:Destroy()
end
break
end
if ftime == 0 then
for _, v in pairs(workspace.MapFolder:GetChildren()) do
v:Destroy()
end
end
for _, v in pairs(game.Players:GetChildren()) do
if v.Character.Humanoid.Health == 0 then
workspace.Players[v.Name]:Destroy()
end
end
end

1 comment
In line 11 you are breaking the while loop.