Open Asterune
Player

Player

Represents a connected player and their session state.

Not creatable
Created by the engine or used as a base class.
Inherits
Instance
Replication
PlayerReplicate

Behavior

Player represents a connected player. The engine creates it on join and removes it on departure. Character references the current character model and is replaced on respawn. Store session state on the player rather than the character when it must persist across respawns.

Summary

Members51
Properties28
Methods17
Events6

Properties

AccountAge

Player.AccountAge: number = 0

The account age in days.

Backpack

Player.Backpack: Backpack?

The container for unequipped tools. Equipping a tool moves it into the character model.

CameraMaxZoomDistance

Player.CameraMaxZoomDistance: number = 400

The maximum camera distance from the character, in studs.

CameraMinZoomDistance

Player.CameraMinZoomDistance: number = 0.5

The minimum camera distance from the character, in studs.

CameraMode

Whether the default camera permits third-person viewing or locks to first person.

CanLoadCharacterAppearance

Player.CanLoadCharacterAppearance: boolean

Whether appearance assets are loaded for the player's character.

Character

Player.Character: Model? = nil

The current character model, or nil between spawns. The model contains character parts and a Humanoid. Reacquire this reference after respawn and check for nil before use.

CharacterAppearanceId

Player.CharacterAppearanceId: number

The user identifier used to load the character's appearance.

CharacterAutoLoads

Player.CharacterAutoLoads: boolean

Whether character loading is automatic for this player.

DevCameraOcclusionMode

Player.DevCameraOcclusionMode: EnumItem

How the default camera handles geometry obscuring the character.

DevComputerCameraMode

Player.DevComputerCameraMode: EnumItem

The default camera movement mode for keyboard and mouse input.

DevComputerMovementMode

Player.DevComputerMovementMode: EnumItem

The default character movement mode for keyboard and mouse input.

DevEnableMouseLock

Player.DevEnableMouseLock: boolean

Whether the player can use the mouse-lock camera mode.

DevTouchCameraMode

Player.DevTouchCameraMode: EnumItem

The default camera movement mode for touch input.

DevTouchMovementMode

Player.DevTouchMovementMode: EnumItem

The default character movement mode for touch input.

DisplayName

Player.DisplayName: string = ""

The display name used for the player or character.

FollowUserId

Player.FollowUserId: number = 0

The user identifier associated with the player's follow join.

GameplayPaused

Player.GameplayPaused: boolean

Whether gameplay is paused for the player.

HealthDisplayDistance

Player.HealthDisplayDistance: number

The maximum distance for the character's health display, in studs.

LocaleId

Player.LocaleId: string

The locale identifier used for this session or player.

MembershipType

Player.MembershipType: EnumItem

The account's membership category.

NameDisplayDistance

Player.NameDisplayDistance: number

The maximum distance for the character's name display, in studs.

Neutral

Player.Neutral: boolean = true

Whether the player is unassigned to a Team.

PlayerGui

Player.PlayerGui: PlayerGui?

The container for this player’s GUI. A ScreenGui parented here is displayed only to this player.

RespawnLocation

Player.RespawnLocation: SpawnLocation?

The SpawnLocation selected for this player's next respawn.

Team

Player.Team: Team? = nil

The player's assigned Team, or nil when no Team is assigned.

TeamColor

Player.TeamColor: BrickColor = BrickColor.new(194)

The color identifying the player's team assignment.

UserId

Player.UserId: number = 0

The permanent numeric account ID. Use it as a key for player data; names can change.

Methods

ClearCharacterAppearance

Player:ClearCharacterAppearance(): ()

Removes appearance instances from the player's character.

DistanceFromCharacter

Player:DistanceFromCharacter(point: Vector3): number

Returns the distance from the character to the supplied world-space point, in studs.

GetExecutionGroup

Player:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetJoinData

Player:GetJoinData(): table

Returns the join and transfer data associated with this player.

GetMouse

Player:GetMouse(): PlayerMouse

Returns the local player's PlayerMouse interface.

GetNetworkPing

Player:GetNetworkPing(): number

Returns the measured network round-trip time for the player.

GetRankInGroup

Player:GetRankInGroup(group_id: number): number

Returns the player's numeric rank in the specified group.

GetRoleInGroup

Player:GetRoleInGroup(group_id: number): string

Returns the player's role name in the specified group.

HasAppearanceLoaded

Player:HasAppearanceLoaded(): boolean

Returns whether the current character appearance has finished loading.

IsFriendsWith

Player:IsFriendsWith(user_id: number): boolean

Returns whether the player is friends with the specified user.

IsGuest

Player:IsGuest(): boolean

Whether the player represents a guest session.

IsInGroup

Player:IsInGroup(group_id: number): boolean

Returns whether the player belongs to the specified group.

IsVerified

Player:IsVerified(): boolean

Whether the account has verified status.

Kick

Player:Kick(message: string?): ()

Disconnects the player with an optional message.

LoadCharacter

Player:LoadCharacter(at: CFrame?): boolean

Loads or respawns the player's character.

Move

Player:Move(walkDirection: Vector3, relativeToCamera: boolean?): ()

Requests movement in a direction. Pass true as the second argument to use camera-relative coordinates instead of world coordinates.

RemoveCharacter

Player:RemoveCharacter(): ()

Removes the player's current character.

Events

CharacterAdded

Player.CharacterAdded: RBXScriptSignal

Fires when the player receives a character Model.

CharacterAppearanceLoaded

Player.CharacterAppearanceLoaded: RBXScriptSignal

Fires when the player's character appearance finishes loading.

CharacterRemoving

Player.CharacterRemoving: RBXScriptSignal

Fires before the player's character is removed.

Chatted

Player.Chatted: RBXScriptSignal

Fires when the player sends a chat message. Passes the message string.

Idled

Player.Idled: RBXScriptSignal

Fires when the player has remained inactive.

OnTeleport

Player.OnTeleport: RBXScriptSignal

Fires when the player's place-transfer state changes.

Inherited members

Inherited47

Example

Luau
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.Character then
  print(player.Character.Name)
end

Players · Humanoid · Team · PlayerGui