I want to know how many players are in the server, how do I do this?
✓ ANSWER ACCEPTED
how can i do count player in sever ?
1 answer
✓ Accepted answer
You pretty much create a table with the player list and loop it in order to check on how many users are in that table. You can use either a local or server script for this and just do something along these lines.
local players = game.Players:GetChildren()
function CountPlayers()
local number = 0
for _, value1 in pairs (players) do
number = number + 1
end
return number
end
print(CountPlayers())
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Or just,, you know,,, print(#game.Players:GetPlayers()),,
-1 for using :GetChildren on players, use :GetPlayers, and for reinventing the wheel