Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Marker

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

Replicated world marker that can emit markerHit and markerLeave events.

new Marker(id): Marker

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

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

Destroys this replicated marker and removes it from connected clients.

void


setColor(r, g, b): void

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

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

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

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

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

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

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

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

Packed replicated marker color.


readonly id: number

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

Immutable network entity identifier.

Entity.id


readonly model: number

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

Replicated marker model identifier.


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

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

Current uniform visual scale.


readonly state: StateBag

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

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

Radius used for player contact events, in world units.


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld