Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I figure out the number of players in a game?

Asked by 10 years ago

Any ideas? I'm not sure how to do it.

1 answer

Log in to vote
2
Answered by 10 years ago

You can either use the NumPlayers property of Players, or you can get the length of the table holding all of the players.

local amountOfPlayers = Game.Players.NumPlayers
--Alternatively;
local amountOfPlayers = #Game.Players:GetPlayers()
0
Ok thx! CardboardRocks 215 — 10y
Ad

Answer this question