Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Prop

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

Replicated static world object created from a Mafia II model.

new Prop(id): Prop

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

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

number

Network entity identifier.

Prop

Entity.constructor

destroy(): void

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

Destroys this replicated prop and removes it from connected clients.

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

Returns a readable representation of this prop.

string

The prop ID formatted for logging or debugging.

Entity.toString


static create(x, y, z, model, rotation?, collision?, virtualWorld?): Prop

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

Creates and replicates a static world prop.

number

Initial world-space X coordinate.

number

Initial world-space Y coordinate.

number

Initial world-space Z coordinate.

number

Mafia II model identifier to instantiate.

Vector3 | Quaternion

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

boolean

Optional solidity; pass false to spawn a pass-through prop with no collision. Defaults to true.

number

Optional virtual-world ID used for visibility filtering.

Prop

The newly created prop handle.

collision: boolean

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

Whether the prop is solid. Set false to make it pass-through for players, vehicles and physics.


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

Mafia II model identifier used by this prop.


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