Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

Prop

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

Replicated static world object created from a Mafia II model.

  • Entity

new Prop(id): Prop

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

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

number

Network entity identifier.

Prop

destroy(): void

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

Destroys this replicated prop and removes it from connected clients.

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

Returns a readable representation of this prop.

string

The prop ID formatted for logging or debugging.


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

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

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

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

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


readonly id: number

Defined in: shared.d.ts:79


readonly model: number

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

Mafia II model identifier used by this prop.


position: Vector3

Defined in: shared.d.ts:81


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:82


readonly virtualWorld: number

Defined in: shared.d.ts:80