Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Marker

Defined in: server/api.d.ts:934

Replicated world marker that can emit markerHit and markerLeave events.

  • Entity

new Marker(id): Marker

Defined in: server/api.d.ts:939

Creates a script wrapper for an existing marker with this ID; use Marker.create() to create a marker.

number

Network entity identifier.

Marker

destroy(): void

Defined in: server/api.d.ts:970

Destroys this replicated marker and removes it from connected clients.

void


setColor(r, g, b): void

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

Changes the marker’s replicated RGB color.

number

Red color component.

number

Green color component.

number

Blue color component.

void


setScale(scale): void

Defined in: server/api.d.ts:976

Changes the marker’s replicated visual scale.

number

Uniform visual scale applied to the marker model.

void


setTriggerRadius(radius): void

Defined in: server/api.d.ts:990

Changes the radius used to emit marker contact events.

number

Contact radius in world units.

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: server/api.d.ts:965

Returns a readable representation of this marker.

string

The marker ID formatted for logging or debugging.


static create(x, y, z, model?, virtualWorld?, triggerRadius?): Marker

Defined in: server/api.d.ts:1002

Creates and replicates a world marker.

number

Initial world-space X coordinate.

number

Initial world-space Y coordinate.

number

Initial world-space Z coordinate.

number

Optional marker model identifier.

number

Optional virtual-world ID used for visibility filtering.

number

Optional radius for markerHit and markerLeave events.

Marker

The newly created marker handle.

readonly color: number

Defined in: server/api.d.ts:954

Packed replicated marker color.


readonly id: number

Defined in: shared.d.ts:79


readonly model: number

Defined in: server/api.d.ts:944

Replicated marker model identifier.


position: Vector3

Defined in: shared.d.ts:81


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:82


readonly scale: number

Defined in: server/api.d.ts:949

Current uniform visual scale.


readonly triggerRadius: number

Defined in: server/api.d.ts:959

Radius used for player contact events, in world units.


readonly virtualWorld: number

Defined in: shared.d.ts:80