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

Is there a way to detect how many players are in a server?

I'm trying to make a game that gives you a badge every time a curtain amount of players are in the server. If you could please send me a script that detects that, I'll be able to take it from there. Thanks.

2 answers

✓ Accepted answer
local badgeservice = game:GetService("BadgeService")
local badge = (numbers)
local player = game.Players.LocalPlayer

while true do
	if game.Players:GetChildren == 50 then
		badgeservice:AwardBadge(player.UserID, badge)
	end
end

This is assuming you have already made the badge and stuff lol. Also this is a local script in starter player scripts.

1 comment

0

Thanks.

local players = game.Players:GetChildren()
local numOfPlayers = #players

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