Search the docs

Find a guide, global, type or member

GlobalEmber

players

The players in this experience's world. Nobody is there yet while main.luau first runs: react to playerJoin or players.onJoin instead.

Functions

players.all() -> { Player }#

Returns every player in the world.

players.get(name: string) -> Player#

Finds a player by name (any case) or UUID string; nil when nobody matches.

players.count() -> number#

Returns how many players are in the world.

players.onJoin(fn: (player: Player) -> ()) -> Subscription#

Calls fn for each player entering the match, after playerJoin handlers. Counts toward the 256-handler limit.

players.onLeave(fn: (player: Player) -> ()) -> Subscription#

Calls fn for each player leaving (/leave or disconnect), after playerLeave handlers. The handle still works inside fn. Counts toward the 256-handler limit.