Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Blocker

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

Invisible replicated collision volume.

new Blocker(id): Blocker

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

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

number

Network entity identifier.

Blocker

Entity.constructor

destroy(): void

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

Destroys this replicated collision volume.

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

Returns a readable representation of this blocker.

string

The blocker ID formatted for logging or debugging.

Entity.toString


static create(x, y, z, sizeX, sizeY, sizeZ, typeMask?, rotation?, virtualWorld?): Blocker

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

Creates and replicates an invisible collision volume.

number

World-space X coordinate of the volume center.

number

World-space Y coordinate of the volume center.

number

World-space Z coordinate of the volume center.

number

Full local width of the volume.

number

Full local depth of the volume.

number

Full local height of the volume.

number

Optional collision mask selecting vehicle and pedestrian blocking.

Vector3 | Quaternion

Optional orientation: a Quaternion, or a Vector3 of Euler angles in degrees.

number

Optional virtual-world ID used for visibility filtering.

Blocker

The newly created blocker handle.

blockPeds: boolean

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

Whether the volume blocks pedestrians and players.


blockVehicles: boolean

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

Whether the volume blocks vehicles.


enabled: boolean

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

Whether collision for this blocker is active.


readonly id: number

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

Immutable network entity identifier.

Entity.id


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 size: Vector3

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

Full local dimensions of the collision volume.


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 virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld