About a week ago, I was trying to make a function that would make it so that if all players are dead or if 1 player is alive it would stop the round, so here is what a few people and I came up with:
[PLAYERDEAD/ALIVE FUNCTION]
local wordValue = game.ReplicatedStorage.valueStorage.wordValue
local timeValue = game.ReplicatedStorage.valueStorage.timeValue
function playersCurrentlyPlaying()
local playerDead = 0
for loopTime, loopPlayers in ipairs (game.Players:GetChildren()) do
if loopPlayers.playValue.Value == 0 then
playerDead = 1
end
end
if playerDead == 0 then
print 'Players are alive!'
elseif playerDead == 1 then
wordValue.Value = "All players have died!"
timeValue.Value = "0:00"
end
end
[FUNCTION IT'S USED IN]
function roundCountdown()
wordValue.Value = 'Time left!'
for minuteTime = 2, 0, -1 do
for secondsTime = 59, 0, -1 do
timeValue.Value = string.format("%d:%.2d", minuteTime, secondsTime)
playersCurrentlyPlaying()
wait(1)
end
end
end
It doesn't seem to work properly and I was wondering if someone could help me fix it so that if all players are dead or if 1 player is alive, it would stop the round?
I'm not an experienced scripter, so please let me know how to fix it with a decent explanation, thanks!

2 comments
Have you asked this question multiple times? I believe I've seen the name of the question at least for the third time already.
Yes, but there hasn't been an answer. This will be the last time though, sorry!