Skip to content

Players

Inherits Instance

Players is the container class for all Player instances.

Static Class

This object is a static class. It can be accessed by using its name as a keyword.

Additionally, it cannot be created in the creator menu or with Instance.New().

Not newable

This object cannot be created by scripts using Instance.New().

Properties

LocalPlayer : Player

The player who is currently playing the game.

PlayerCollisionEnabled : boolean

Determines whether or not collisions between players are enabled.

PlayersCount : number

The number of players currently in the game.

Methods

GetPlayers → table

Parameters: ``

Returns a table containing all the players currently in the game.

GetPlayer → Player

Parameters: username [ string ]

Returns the player with the specified username.

GetPlayerByID → Player

Parameters: userID [ number ]

Returns the player with the specified user ID.

Events

PlayerAdded

Parameters: player [ Player ]

Fires when player has connected

PlayerRemoved

Parameters: player [ Player ]

Fires when player has disconnected