Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get number of children in players?

Asked by
Seenit 80
10 years ago

Im using:

for _,player in next, game.Players:GetChildren() do

But I need to get the number of children there are.

1 answer

Log in to vote
-1
Answered by 10 years ago

if you wanna get the current number of players

print(game.Players.NumPlayers)

or if you wanna loop through every player

for i, v in pairs(game.Players:GetPlayers()) do
    --BLAH
end

that +1 :D

Ad

Answer this question