I'm making a game and I want to know if everyone has died.
while true do wait()
local allFalse = true
if game.ServerStorage.Game.GameRunning.Value == true then
for _, player in pairs(game.Players:GetPlayers()) do
if player.Values.IsPlaying.Value == true then
allFalse = false
break
end
end
end
if allFalse == true then
print("Game Over.")
end
end
When someone dies the IsPlaying value is set to false. The GameRunning value is just a value thats true when the game is running.
Right now I just get the Game Over message spammed in the console.
I'd really appriciate some help! ^_^

2 comments
You can check in pairs if all players value "Dead" is true
That doesn't answer my question.