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.
id
The ID of the player — every player in the world has a unique ID. 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.
rotation
The current rotation of the player (in degrees). This property is read-only.
isInvulnerable
Determines whether the player can take damage. Setting to true will allow the player to lose health when hit by weapons or hazards. Setting to false will prevent the player from losing health.
position
Gets or sets the current position.
scale
Gets or sets the current scale.
networkId
Gets the network ID of the object. This property is read-only.
onDestroy
Assigns a function that will be called when the object is destroyed. 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.
Functions
destroy()
Destroys the object.