• Count dead players.
    2 replies, posted
Is there a way to count how many dead players are on a server ? Ex: if dead players is > 0 then ... end
Something like this? [CODE] function GetDeadPlayerCount() local deadPlayers = 0 for _, ply in pairs(player.GetAll()) do if not ply:Alive() then deadPlayers = deadPlayers + 1 end end return deadPlayers end [/CODE]
EDIT: ninjas [CODE]local dead = 0 for k, v in pairs( player.GetAll() ) do if !v:Alive() then dead = dead + 1 end end[/CODE]
Sorry, you need to Log In to post a reply to this thread.