OtherPlayers

OtherPlayers is not creatable, there's only one instance of it. It can only be accessed through its globally exposed variable.

OtherPlayers is a table containing all Players except the local one.

OtherPlayers is not available to the Server, because it just wouldn't make sense! 🙂

Players are indexed by their "player ID". Player IDs range from 0 to 15.

⚠️ Don't use ipairs for iterating over OtherPlayers, but only pairs.

for id, player in pairs(OtherPlayers) do
  -- id and player.ID have the same value here
  print(id, player.ID, player.Username)
end