Players on the map||doc136120

September 20, 2022

Format

 Map.players 
  • The class to which the attribute belongs:Map

This property can only be accessed on the server side


Description

A table of all players located in this map, with the player ID as the key and the player instance as the value.


Value Returned

type Description
table A table of player instances


Code Samples

Print the player id and instance in the map

local map = World.CurWorld.defaultMap
for id, player in pairs(map.players) do
    print(id,player)
end