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

How can i detect how many player left in the server?

Can somebody help me? I need a script that tell how many player is left in server

1 comment

0

print(#game.Players:GetChildren())

1 answer

✓ Accepted answer

you can do this, it will update every time someone leaves/joins:

game.Players.PlayerAdded:Connect(function()
	local players = game.Players:GetPlayers()
	
	print(#players)
end)

game.Players.PlayerRemoving:Connect(function()
	local players = game.Players:GetPlayers()
	
	print(#players)
end)

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