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

See how many players are in a place?

Is it possible to see how many players are in a place/universe place with a script?

1 answer

✓ Accepted answer

You could find that out with two efficient ways:

local plrs_in_game = game.Players.NumPlayers

or

local plrs_in_game = #game.Players:GetPlayers()

Both of them will return the number of players in the server.

If you want to find out how many in a place, you would have to use datastores

game.Player.PlayerAdded:connect(function()
game:GetService("DataStoreService"):GetDataStore("Plrs"):IncrementAsync("Players",1)
end)

game.Player.PlayerRemoving:connect(function()
game:GetService("DataStoreService"):GetDataStore("Plrs"):IncrementAsync("Players",-1)
end)

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