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!
Line 15:
elseif playerDead == 1 then wordValue = "All players have died!" timeValue = "0:00" end