Skip to main content

Player

Provides properties and functions to interact with a Player in the world.

Properties

isPlayer

Indicates whether the object is a player. This property is read-only.

name

The nickname of the player. This property is read-only.

clientId

The connection ID of the player — use this when calling functions that apply to a specific player. This property is read-only.

isOnHoverboard

Indicates whether the player is riding their hoverboard or not. This property is read-only.

isInvulnerable

Determines whether the player can take damage. Setting to false will allow the player to lose health when hit by weapons or hazards. Setting to true will prevent the player from losing health.

velocity

Gets the velocity of the player. This property is read-only.

isEntity

Indicates whether the object is an Entity. This property is read-only.

networkId

Gets the network ID of the object. This property is read-only.

forward

Gets forward vector of the object. This property is read-only.

position

Gets/sets the current position.

rotation

Gets/sets the current rotation (in degrees).

scale

Sets the current scale.

onDestroy

Assigns a function that will be called when the object is destroyed. This property is write-only.

onDamage

Assigns a function that will be called when the object receives damage. This property is write-only.

onSensorEnter

Assigns a function that will be called when an object enters the sensor. This property is write-only.

onSensorExit

Assigns a function that will be called when an object leaves the sensor. This property is write-only.

onScriptReload

Assigns a function that will be called when the script assigned to the object changes. This property is write-only.

Functions

destroy()

Destroys the object.