Hey Smach28,
There's another way to get the amount of players, that is way better than doing :GetChildren(). Also, :GetChildren() is about the worst way you can approach this because, what if there are other objects in the Players service? It will count those objects as players. I would recommend, if you're getting a table of Players, to do :GetPlayers() on the Players service, like this:
wait(2);
local player_service = game:GetService("Players")
local players = player_service:GetPlayers();
print(#players .. " is the amount of players.");
###That's one way to do it but, the way that I use most of the time is just to use the Players Service's NumPlayers property, to tell me the amount of players;
wait(2);
local players = game:GetService("Players");
local amount = players.NumPlayers;
print(amount .. " is the amount of players.");
##Well, I hope I helped and have a nice day/night.
~~ KingLoneCat
1 comment
Note that it's almost if not always a better idea to use :GetPlayers() instead of :GetChildren() when you want a list of players.