Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Blocker

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

Invisible replicated collision volume.

  • Entity

new Blocker(id): Blocker

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

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

number

Network entity identifier.

Blocker

destroy(): void

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

Destroys this replicated collision volume.

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

Returns a readable representation of this blocker.

string

The blocker ID formatted for logging or debugging.


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

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

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 radians.

number

Optional virtual-world ID used for visibility filtering.

Blocker

The newly created blocker handle.

blockPeds: boolean

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

Whether the volume blocks pedestrians and players.


blockVehicles: boolean

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

Whether the volume blocks vehicles.


enabled: boolean

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

Whether collision for this blocker is active.


readonly id: number

Defined in: shared.d.ts:79


position: Vector3

Defined in: shared.d.ts:81


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:82


readonly size: Vector3

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

Full local dimensions of the collision volume.


readonly virtualWorld: number

Defined in: shared.d.ts:80