Hi I was making a game script and I made it so that if the round is over then everyones dies. But with my script it makes a constant death. Please help?
local gameOver = false
while true do
wait()
for _, player in next, game.Players:GetPlayers() do
if getScore(player, "Cow Clicks") >= highScore then
gameOver = true
end
end
if gameOver then
warn("wins")
wait(1)
for i,v in pairs (game.Players:GetChildren()) do
v.Character.Humanoid.Health = 0
end
end
end

1 comment
It does that because you put it in a while loop. Remove the while loop.