A few hours ago I asked a question saying 'How do I make a function so that if all players are dead or if 1 person is alive the round ends' and some one help me come out with this:
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!'
else
wordValue = 'All players have died!'
timeValue = '0:00'
end
end
It wont 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!

3 comments
Test it.
I did, it doesn't work.
Instead of setting a value to one, why not loop through and increment the playerDead variable? Then you can check the number of it as you are on line 13.