Can somebody help me? I need a script that tell how many player is left in server
✓ ANSWER ACCEPTED
How can i detect how many player left in the server?
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.

1 comment
print(#game.Players:GetChildren())