We use cookies on this site to enhance your user experience

A Player object a client that is currently connected. These objects are added to the Players service when a new player connects, then removed when they eventually disconnect from the server.

The Instance/Name property reflects the player’s username. When saving information about a player, you should use their Player/UserId since it is possible that a player can change their username.

There are several similar methods in the Players for working with Player objects. Use these over their respective Instance methods:

  • You can get a table of current Player objects using Players/GetPlayers; again, use this instead of Instance/GetChildren.
  • To detect the addition of Player objects, it is recommended to use the Players/PlayerAdded event (instead of Instance/ChildAdded on the Players service).
  • Similarly, you can detect the removal of Player objects using Players/PlayerRemoving, which fires just before the Player is removed (instead of Instance/ChildRemoved which fires after). This is important if you are saving information about the player that might be removed or cleaned up on-removal.

Properties

Name Type Description
int

Describes the player’s account age in days.

bool

Determines whether the character of a player using a mobile device will automatically jump upon hitting an obstacle.

float

The maximum distance the player’s camera is allowed to zoom out.

float

The minimum distance the player’s camera is allowed to zoom in.

CameraMode

Changes the camera’s mode to either first or third person.

bool

Determines whether the character’s appearance will be loaded when the player spawns. If false, the player will spawn with a default appearance.

Model

A model containing the humanoid, arms, legs, torso, and scripts of a player’s character. Initially this property is set to nil, and is set when the player’s character spawns.

int64

Determines the user ID of the account whose character appearance is used for a player’s character.

DevCameraOcclusionMode

Sets how the default camera handles objects between the camera and the player.

DevComputerCameraMovementMode

Lets developer overwrite the default camera mode for each player if the player is on a computer.

DevComputerMovementMode

Lets developer overwrite the default movement mode for each player if the player is on a computer.

bool

Determines if a player can toggle mouse lock by default.

DevTouchCameraMovementMode

Lets developer overwrite the default camera movement mode for each player if the player is on a mobile device.

DevTouchMovementMode

Lets developer overwrite the player’s movement mode if the player is on a touch device.

int64

Describes the user ID of the player who was followed into a game by a player.

float

Sets the distance at which this player will see other Humanoid’s health bars. If set to 0, the health bars will not be displayed.

string
float

The maximum value that the Player’s SimulationRadius can grow to.

MembershipType

Holds an Enum of the account’s membership type (NBC, BC, TBC and OBC).

float

Sets the distance at which this player will see other Humanoid’s names. If set to 0, names are hidden.

bool

Determines whether the player is on a specific team or not.

Instance

Sets the part to focus replication around.

SpawnLocation

If set, the player will respawn at the given SpawnLocation.

float

The simulation radius of the Player’s Character.

Team

Determines the Team with which a Player is associated.

BrickColor

Determines the Team with which a Player is associated.

int64

A unique identifying integer assigned to all user accounts.

Inherited from Instance

Archivable ClassName DataCost Name Parent RobloxLocked

Functions

Name Type Description
void

Removes all accessories and other character appearance objects from a player’s Character.

float

Returns the distance between the character’s head and the given Vector3 point. Returns 0 if the player has no character.

Array

Return a dictionary of online friends, specified by maxFriends.

Dictionary

Returns a dictionary of data pertaining to how this player joined the game.

Instance

Returns the mouse being used by the client.

int

Returns the player’s rank in the group as an integer between 0 and 255, where 0 is a non-member and 255 is the group’s owner.

string

Returns the player’s role in the group as a string, or “Guest” if the player isn’t part of the group.

bool

Returns whether or not the appearance of the player’s character has loaded

bool

Checks whether a player is a friend of the user with the given ID.

bool

Checks whether a player is a member of a group with the given ID.

void

Forcibly disconnect a player from the game, optionally providing a message.

void

Creates a new character for the player, removing the old one. Also clears the player’s Backpack and PlayerGui.

void

Places the given instance either in the player’s character, head, or StarterGear based on the instance’s class.

void

Functions similar to Player/LoadCharacter, but the request is processed synchronously instead of asynchronously.

This means that no other task will be able to continue until after the character has been loaded, including the rendering of the game and any other tasks.

Notes

  • This function is used by Roblox's backend server when rendering avatar thumbnails.


void

Causes the player’s character to walk in the given direction until stopped, or interrupted by the player (by using their controls).

void

Removes the player’s character.

void

Sets the AccountAge of the player.

void

Sets whether or not the player sees filtered chats, rather than normal chats.

Inherited from Instance

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild

Events

Name Type Description

Fired when a player’s character spawns or respawns.

Fires whenever a character has loaded its appearance

Fired when a player’s character is about to be removed.

Fires when a player chats in-game using Roblox’s provided chat bar.

Usually fired two minutes after the game engine classes the player as idle. Time is the amount of seconds since this point.

Fired when the TeleportState of a player changes.

Fired when the Player’s SimulationRadius is changed.

Inherited from Instance

AncestryChanged Changed ChildAdded ChildRemoved DescendantAdded DescendantRemoving