Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get the current number of players in a server?

I saw that there was a NumPlayers property, but it seems to be deprecated.

1 comment

0

I never liked how it became deprecated considering it's faster than #game.Players:GetPlayers() , but you can use that if you prefer it

1 answer

✓ Accepted answer
local numPlayers = #game.Players:GetChildren() -- Or GetPlayers() whatever your preference is

5 comments

0

Thank you!

0

what does the # do?

0

It's like a count, it gets the number of elements in a table.

0

Works, but game.Players.NumPlayer would do the same

0

It's deprecated, don't NumPlayer.

This discussion is preserved as it was. New answers, comments, and votes are closed.