Skip to main content

sm.player

Associated object type: Player

A player is a user playing the game. Every player controls a Character in the world.

Functions

getAllPlayers

sm.player.getAllPlayers()

Returns a table of all players that are currently in the game.

note

When loading a world, there is a small period of time (a few ticks) during which this function
will return an empty table (no players in the world yet)!

Because of this, it is not recommended to rely on this function returning a player
when using it in a script's server_onCreate or client_onCreate callback.

Returns:
  • [ table ]: The table of players.