So basically, each person that joins the game gets an IntValue named "Playing" spawned inside them set to 0. Well, when my minigame thing initiates, everyone's 'Playing' value gets set to 1. Then when they die, it gets set back to 0.
What I need help figuring out is how would I find the amount of people who have their 'Playing' value set to 1? Below, you can see what I tried doing, but the third line isn't valid.
function onePersonLeft()
for i, player in pairs(game.Players:GetPlayers()) do
if #player.Playing.Value == 1 then return true
else return false
end
end
end

1 comment
Remove the #; the # gives the number of objects in a table such as game.Players:GetPlayers(), but for i, player in pairs returns player as one of the values of that table. By the way, couldn't you just use a BoolValue for this? It would accomplish the same thing except with true/false instead of 1/0.