A day ago I asked a question saying 'How do I make a function so that if all players are dead or if 1 player is alive the round ends?' and some one help me come up with this:
[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 = "All players have died!"
timeValue = "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 won't work and I'm not a very experienced scripter, so please let me know how or why it is wrong and a way to fix it, thanks!

4 comments
It does work, but when one player dies the entire round ends. I wanted it so that if all players die or if 1 player is alive.
Also, when playerDead == 1 it doesn't with the rest of the function's. If you don't understand what I'm saying then I'll be happy to let you 'inspect' the code.
Ok. I'll be able to do it later today, PM my main account (EmeraldSlash)
Alright, thanks!