Skip to content
M2O Scripting APIScripting reference
Runtime classClient APIGenerated

Player

Defined in: client/api.d.ts:960

Client handle for a streamed M2O player.

  • Player

new Player(id): Player

Defined in: client/api.d.ts:965

Creates a script wrapper for an existing streamed player with this ID; it does not create or spawn a player.

number

Network entity identifier.

Player

emit(eventName, payloadJson?): void

Defined in: shared.d.ts:96

string

string

void


getBoneTransform(boneId): BoneTransform | null

Defined in: client/api.d.ts:978

Resolves the current world-space transform of one of this player’s skeleton bones.

number

Numeric bone identifier, typically obtained from the global Bone table.

BoneTransform | null

The bone transform, or null when the player or requested bone is unavailable.


getIP(): string

Defined in: shared.d.ts:97

string


getNametagColor(): number

Defined in: shared.d.ts:105

number


getNametagText(): string

Defined in: shared.d.ts:103

string


getVehicle(): Vehicle | null

Defined in: client/api.d.ts:984

Returns the streamed vehicle currently occupied by this player.

Vehicle | null

The current vehicle handle, or null when the player is not inside a streamed vehicle.


isNametagHealthVisible(): boolean

Defined in: shared.d.ts:101

boolean


isNametagVisible(): boolean

Defined in: shared.d.ts:99

boolean


kick(reason?): void

Defined in: shared.d.ts:95

string

void


setNametagColor(color): void

Defined in: shared.d.ts:104

number

void


setNametagHealthVisible(visible): void

Defined in: shared.d.ts:100

boolean

void


setNametagText(text?): void

Defined in: shared.d.ts:102

string

void


setNametagVisible(visible): void

Defined in: shared.d.ts:98

boolean

void


setVirtualWorld(world): void

Defined in: shared.d.ts:83

number

void


setVisibleTo(player): void

Defined in: shared.d.ts:84

Entity | null

void


toString(): string

Defined in: client/api.d.ts:971

Returns a readable representation of this player handle.

string

The player ID formatted for logging or debugging.

readonly discordId: string

Defined in: shared.d.ts:91


readonly hardwareId: string

Defined in: shared.d.ts:92


readonly id: number

Defined in: shared.d.ts:79


readonly ip: string

Defined in: shared.d.ts:94


readonly ping: number

Defined in: shared.d.ts:93


position: Vector3

Defined in: shared.d.ts:81


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:82


readonly steamId: string

Defined in: shared.d.ts:90


readonly virtualWorld: number

Defined in: shared.d.ts:80