Player
Defined in: client/api.d.ts:1611
Client handle for a streamed M2O player.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Player(
id):Player
Defined in: client/api.d.ts:1616
Creates a script wrapper for an existing streamed player with this ID; it does not create or spawn a player.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Player
Methods
Section titled “Methods”getBoneTransform()
Section titled “getBoneTransform()”getBoneTransform(
boneId):BoneTransform|null
Defined in: client/api.d.ts:1629
Resolves the current world-space transform of one of this player’s skeleton bones.
Parameters
Section titled “Parameters”boneId
Section titled “boneId”number
Numeric bone identifier, typically obtained from the global Bone table.
Returns
Section titled “Returns”BoneTransform | null
The bone transform, or null when the player or requested bone is unavailable.
getNametagColor()
Section titled “getNametagColor()”getNametagColor():
number
Defined in: client/api.d.ts:4026
Reads this player’s nametag color.
Returns
Section titled “Returns”number
Packed 0xAARRGGBB color; opaque white when untinted.
Inherited from
Section titled “Inherited from”getNametagText()
Section titled “getNametagText()”getNametagText():
string
Defined in: client/api.d.ts:4020
Reads this player’s nametag text override.
Returns
Section titled “Returns”string
The override, or an empty string when the player’s own name is drawn.
Inherited from
Section titled “Inherited from”getTeam()
Section titled “getTeam()”getTeam():
number
Defined in: client/api.d.ts:1647
Returns the team this player belongs to. Teams are assigned by the server; the client only reads them.
Returns
Section titled “Returns”number
The team id, or 0 when the player is on no team.
getVehicle()
Section titled “getVehicle()”getVehicle():
Vehicle|null
Defined in: client/api.d.ts:1635
Returns the streamed vehicle currently occupied by this player.
Returns
Section titled “Returns”Vehicle | null
The current vehicle handle, or null when the player is not inside a streamed vehicle.
getVehicleSeat()
Section titled “getVehicleSeat()”getVehicleSeat():
number
Defined in: client/api.d.ts:1641
Returns the seat this player occupies in their current streamed vehicle.
Returns
Section titled “Returns”number
The seat index, 0 for the driver, or -1 when the player is not in a vehicle.
isNametagHealthVisible()
Section titled “isNametagHealthVisible()”isNametagHealthVisible():
boolean
Defined in: client/api.d.ts:4014
Checks whether the health bar under this player’s nametag is shown.
Returns
Section titled “Returns”boolean
True unless the health bar was hidden; false also when this game has no nametags.
Inherited from
Section titled “Inherited from”BasePlayer.isNametagHealthVisible
isNametagVisible()
Section titled “isNametagVisible()”isNametagVisible():
boolean
Defined in: client/api.d.ts:4008
Checks whether this player’s nametag is shown to other players.
Returns
Section titled “Returns”boolean
True unless the nametag was hidden; false also when this game has no nametags.
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: client/api.d.ts:1622
Returns a readable representation of this player handle.
Returns
Section titled “Returns”string
The player ID formatted for logging or debugging.
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”
readonlyid:number
Defined in: client/api.d.ts:3926
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”position
Section titled “position”position:
Vector3
Defined in: client/api.d.ts:3936
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: client/api.d.ts:3941
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlystate:StateBag
Defined in: client/api.d.ts:3946
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: client/api.d.ts:3931
Current virtual-world identifier.
