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

Is it possible to detect how many players are in a game?

I'm quite curious about this question, and I'd like to know. I'd like to make a TextLabel, and add a script that changes the text whenever one joins or leaves a game.

2 answers

✓ Accepted answer

Simple line:

while wait(60) do
local players = game.Players:GetChildren()
print("There are "..#players.." players in the game!")
end

This will just say how many players there are every minute

1 comment

0

(Simple lines)

Very simple. Do this in the dev console

print(#game:GetService("Players"):GetPlayers())

or

print(#game:GetService("Players"):GetChildren())

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