FANDOM


The Player class inherits from Instance. This class is used as a reference for all the players in the place.

Properties

Pubfield int AccountAge

The amount of days that have passed since this account's creation date.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Protfield bool AppearanceDidLoad

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Pubfield bool AutoJumpEnabled

Whether or not the player automatically jumps when hitting an object on a mobile device.

Category: Data.

Serialization: can save and load.

Pubfield float CameraMaxZoomDistance

How far the player can zoom out. Maximum is 400.

Category: Camera.

Serialization: can save and load.

Pubfield float CameraMinZoomDistance

How much the player can zoom in.

Category: Camera.

Serialization: can save and load.

Pubfield CameraMode CameraMode

An enum that describes how a Player's camera is allowed to behave.

Category: Camera.

Serialization: can save and load.

Pubfield bool CanLoadCharacterAppearance

If set to true, the game will automatically load a character's appearance when respawning.

Category: Behavior.

Serialization: cannot load or save.

Pubfield Model Character

The model of the player, containing the limbs, any accessories the player is wearing, and any ExplorerImageIndex 17Tools the player is holding.

Category: Data.

Serialization: can save and load.

Pubfield string CharacterAppearance

Category: Data.

Serialization: can save and load.

Tags: NotBrowsable, Deprecated.

Pubfield int64 CharacterAppearanceId

Determines the UserId of the user that this player will look like when they respawn. Defaults to their UserId.

Category: Data.

Serialization: can save and load.

Protfield ChatMode ChatMode

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield int DataComplexity

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Protfield int DataComplexityLimit

Category: Data.

Read security: LocalUserSecurity.

Write security: LocalUserSecurity.

Serialization: can load only.

Tags: NotReplicated, Deprecated.

Pubfield bool DataReady

Read-only. If true, this Player's persistent data can be loaded, false otherwise.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Pubfield DevCameraOcclusionMode DevCameraOcclusionMode

Category: Camera.

Serialization: can save and load.

Pubfield DevComputerCameraMovementMode DevComputerCameraMode

Category: Camera.

Serialization: can save and load.

Pubfield DevComputerMovementMode DevComputerMovementMode

Category: Control.

Serialization: can save and load.

Pubfield bool DevEnableMouseLock

Category: Camera.

Serialization: can save and load.

Pubfield DevTouchCameraMovementMode DevTouchCameraMode

Category: Camera.

Serialization: can save and load.

Pubfield DevTouchMovementMode DevTouchMovementMode

Category: Control.

Serialization: can save and load.

Protfield string DisplayName

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Pubfield int64 FollowUserId

The UserId of the player this player followed into the game. Will be 0 if the player did not follow anyone.

Category: Data.

Serialization: can save only.

Tags: ReadOnly, NotReplicated.

Protfield bool GameplayPaused

Category: Behavior.

Write security: NotAccessibleSecurity.

Serialization: can save and load.

Protfield bool Guest

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield float HealthDisplayDistance

How far this player's health bar is shown in the 3D world.

Category: Camera.

Serialization: can save and load.

Pubfield string LocaleId

Category: Data.

Serialization: cannot load or save.

Tags: Hidden, ReadOnly, NotReplicated.

Protfield float MaximumSimulationRadius

Category: Data.

Read security: LocalUserSecurity.

Write security: LocalUserSecurity.

Serialization: can load only.

Tags: NotReplicated.

Pubfield MembershipType MembershipType

An enum describing what type of Builders Club this player has.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield float NameDisplayDistance

How far this player's name is shown.

Category: Camera.

Serialization: can save and load.

Pubfield bool Neutral

Whether or not this player is on no teams.

Category: Team.

Serialization: can save and load.

Protfield string OsPlatform

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Pubfield Instance ReplicationFocus

Category: Data.

Serialization: can save and load.

Pubfield SpawnLocation RespawnLocation

The ExplorerImageIndex 25SpawnLocation this player will spawn at. If set to nothing, the SpawnLocation will be chosen randomly, based on the team options.

Category: Data.

Serialization: can save and load.

Protfield float SimulationRadius

Category: Data.

Read security: LocalUserSecurity.

Write security: LocalUserSecurity.

Serialization: cannot load or save.

Pubfield Team Team

The ExplorerImageIndex 24Team this player is on.

Category: Team.

Serialization: can save and load.

Tags: NotReplicated.

Pubfield BrickColor TeamColor

The color of the team this player is on.

Category: Team.

Serialization: can save and load.

Protfield bool Teleported

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Tags: Hidden, ReadOnly, NotReplicated.

Protfield bool TeleportedIn

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: can save and load.

Pubfield int64 UserId

A unique identifier for the player that never changes. Unlike other important properties, this property is not ReadOnly. However, it does error if you attempt to edit it.

Category: Data.

Serialization: cannot load or save.

Protfield string VRDevice

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Pubfield int64 userId

Deprecated. Use UserId instead.

Category: Data.

Serialization: cannot load or save.

Tags: Deprecated.

Functions

Protmethod void AddToBlockList(Array userIds)

Security: RobloxScriptSecurity.

Pubmethod void ClearCharacterAppearance()

Clears the appearance of the character.

Pubmethod float DistanceFromCharacter(Vector3 point)

Returns the distance between this player's head and the given point. Will be nil if this player does not have a character.

Protmethod FriendStatus GetFriendStatus(Instance player)

Security: RobloxScriptSecurity.

Pubmethod Array GetFriendsOnline(int maxFriends = 200)

Returns an array of players that are online and friended with the player.

Tags: Yields.

Protmethod string GetGameSessionID()

Security: RobloxSecurity.

Pubmethod Dictionary GetJoinData()

Pubmethod Instance GetMouse()

Returns a ExplorerImageIndex 0PlayerMouse that the player is using. Only works in ExplorerImageIndex 18LocalScripts.

Example:

-- LocalScript inside of StarterPlayerScripts
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()print(mouse.Icon)

Pubmethod int GetRankInGroup(int64 groupId)

Gets the player's rank in the given group id.

Tags: Yields.

Pubmethod string GetRoleInGroup(int64 groupId)

Gets the player's role in the given group id.

Tags: Yields.

Protmethod bool GetUnder13()

Returns if the player is Under 13 or not.

Security: RobloxScriptSecurity.

Pubmethod bool HasAppearanceLoaded()

Whether or not this player's appearance has fully loaded.

Pubmethod bool IsBestFriendsWith(int64 userId)

Checks whether or not this player is best friends with the given userId. This function is deprecated because best friends have been removed.

Tags: Yields, Deprecated.

Pubmethod bool IsFriendsWith(int64 userId)

Checks whether this player is friends with the given userId.

Tags: Yields.

Pubmethod bool IsInGroup(int64 groupId)

Whether or not this player has a rank of 1+ in the given group id.

Tags: Yields.

Pubmethod bool IsUserAvailableForExperiment()

Tags: Deprecated.

Pubmethod void Kick(string message = )

Removes the player from the game, with the red disconnect message being message. If no message is supplied, it defaults to "This game has shut down."

Pubmethod bool LoadBoolean(string key)

Tags: Deprecated.

Pubmethod void LoadCharacter()

Loads in a new character for this player. This will replace the player's current character, if they have one. This should be used in conjunction with Players.CharacterAutoLoads to control spawning of characters. This function only works from a server-side script, not from a ExplorerImageIndex 18LocalScript.

Tags: Yields.

Pubmethod void LoadCharacterAppearance(Instance assetInstance)

Tags: Deprecated.

Protmethod void LoadCharacterBlocking()

Security: LocalUserSecurity.

Tags: Yields.

Pubmethod void LoadCharacterWithHumanoidDescription(Instance humanoidDescription)

Tags: Yields.

Protmethod void LoadData()

Security: LocalUserSecurity.

Tags: Deprecated.

Pubmethod Instance LoadInstance(string key)

Tags: Deprecated.

Pubmethod double LoadNumber(string key)

Tags: Deprecated.

Pubmethod string LoadString(string key)

Tags: Deprecated.

Pubmethod void Move(Vector3 walkDirection, bool relativeToCamera = false)

Makes the player walk in the given direction, until stopped or interrupted by the player.

Protmethod void RemoveCharacter()

Security: LocalUserSecurity.

Protmethod void RequestFriendship(Instance player)

Security: RobloxScriptSecurity.

Protmethod void RevokeFriendship(Instance player)

Security: RobloxScriptSecurity.

Pubmethod void SaveBoolean(string key, bool value)

Tags: Deprecated.

Protmethod void SaveData()

Security: LocalUserSecurity.

Tags: Deprecated.

Pubmethod void SaveInstance(string key, Instance value)

Tags: Deprecated.

Pubmethod void SaveNumber(string key, double value)

Tags: Deprecated.

Pubmethod void SaveString(string key, string value)

Tags: Deprecated.

Protmethod void SetAccountAge(int accountAge)

Security: PluginSecurity.

Protmethod void SetMembershipType(MembershipType membershipType)

Security: RobloxScriptSecurity.

Protmethod void SetSuperSafeChat(bool value)

Security: PluginSecurity.

Protmethod void SetUnder13(bool value)

Security: RobloxSecurity.

Tags: Deprecated.

Protmethod void UpdatePlayerBlocked(int64 userId, bool blocked)

Security: RobloxScriptSecurity.

Pubmethod bool WaitForDataReady()

Yields until the persistent data for this Player is ready to be loaded.

Tags: Yields, Deprecated.

Pubmethod bool isFriendsWith(int64 userId)

Deprecated. Use IsFriendsWith instead.

Tags: Yields, Deprecated.

Pubmethod bool loadBoolean(string key)

Tags: Deprecated.

Pubmethod Instance loadInstance(string key)

Tags: Deprecated.

Pubmethod double loadNumber(string key)

Tags: Deprecated.

Pubmethod string loadString(string key)

Tags: Deprecated.

Pubmethod void saveBoolean(string key, bool value)

Tags: Deprecated.

Pubmethod void saveInstance(string key, Instance value)

Tags: Deprecated.

Pubmethod void saveNumber(string key, double value)

Tags: Deprecated.

Pubmethod void saveString(string key, string value)

Tags: Deprecated.

Pubmethod bool waitForDataReady()

Tags: Yields, Deprecated.

Events

Pubevent CharacterAdded(Instance character)

Fired when the player gets a character.

Pubevent CharacterAppearanceLoaded(Instance character)

Fired when the character's appearance loaded.

Pubevent CharacterRemoving(Instance character)

Fired when the player's character is about to be removed.

Pubevent Chatted(string message, Instance recipient)

Fired when the player sends a message via the ROBLOX chat bar. recipient is the player the message was sent to, or nil if it was sent to no individual player.

Protevent FriendStatusChanged(Instance player, FriendStatus friendStatus)

Security: RobloxScriptSecurity.

Pubevent Idled(double time)

Fired periodically after the user has been AFK for a while. Currently this event is only fired for the *local* Player. "time" is the time in seconds that the user has been idle.

Pubevent OnTeleport(TeleportState teleportState, int64 placeId, string spawnName)

Fired when the player is being teleported via ExplorerImageIndex 70TeleportService.

Protevent SimulationRadiusChanged(float radius)

Security: LocalUserSecurity.


External links

Community content is available under CC-BY-SA unless otherwise noted.