GetNumberOfPlayers
From Nomad DB
Revision as of 19:25, 14 April 2020 by Wasdennnoch (talk | contribs) (Created page with "Get the number of players in the current play session. == Syntax == <syntaxhighlight lang="lua"> GetNumberOfPlayers() </syntaxhighlight> * '''Returns''' (number): Player Coun...")
Get the number of players in the current play session.
Syntax
GetNumberOfPlayers()
- Returns (number): Player Count
Example
local playerCount = GetNumberOfPlayers()
for i = 0, playerCount - 1 do
local playerEntityId = GetEntityIdFromPlayerIndex(i)
-- do stuff
end