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

How to check the amount of players in game?

Asked by 5 years ago

I am trying to kick someone if the player number exceeds the limit but don't know what function is used to get players

1 answer

Log in to vote
3
Answered by
PolyyDev 214 Moderation Voter
5 years ago
print(#game:GetService("Players"):GetPlayers())

That get's the length of the players table which is retrieved with the GetPlayers method of the Players service

Ad

Answer this question