Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Marker

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

Replicated world marker that can emit markerHit and markerLeave events.

new Marker(id): Marker

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

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

number

Network entity identifier.

Marker

Entity.constructor

destroy(): void

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

Destroys this replicated marker and removes it from connected clients.

void


setColor(r, g, b): void

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

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:1308

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:1322

Changes the radius used to emit marker contact events.

number

Contact radius in world units.

void


setVirtualWorld(world): void

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

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void

Entity.setVirtualWorld


setVisibleTo(player): void

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

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void

Entity.setVisibleTo


toString(): string

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

Returns a readable representation of this marker.

string

The marker ID formatted for logging or debugging.

Entity.toString


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

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

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:1286

Packed replicated marker color.


readonly id: number

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

Immutable network entity identifier.

Entity.id


readonly model: number

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

Replicated marker model identifier.


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

Entity.rotation


readonly scale: number

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

Current uniform visual scale.


readonly state: StateBag

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

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.

Entity.state


readonly triggerRadius: number

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

Radius used for player contact events, in world units.


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld