Deprecate Players.NumPlayers

We have two good ways to find the number of players in a game:
#game.Players:GetPlayers() and Players.NumPlayers

The former is universal – I can do:

#game.Players:GetPlayers()
#team:GetPlayers()
#model:GetChildren()
#Keyframe:GetPoses()
#Humanoid:GetAccessories()
#workspace:FindPartsInRegion3()
#UserInputService:GetConnectedGamepads()
#plugin:Separate()
#InsertService:GetBaseSets()
#CollectionService:GetCollection()
#LogService:GetLogHistory()

But there’s no way for me to use model.NumChildren, humanoid.NumAccesories, etc. Players.NumPlayers is an oddball and not really consistent. It should be deprecated.

8 Likes

Yeah, it probably should be deprecated, but honestly you’ll probably want to know how many players there are in-game more than you’ll want to check other things like the number of children in a model.

Not sure about that. Very rarely have I used #players in my games – the only times I have were for displaying the number of players in-game on a GUI or checking if there were enough players to start a round. Either way, it’s not used enough to warrant its own property.

I use it fairly often, but it’s usually #Players:GetPlayers() as opposed to Players.NumPlayers. I had legitimately forgotten that property was a thing.

NumPlayers sounds like a variable name rather than a proper API member name, “PlayerCount” or something would be better if not deprecated entirely.

Yeah, I will try to deprecate this.

6 Likes