Prop
Defined in: server/api.d.ts:1342
Replicated static world object created from a Mafia II model.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Prop(
id):Prop
Defined in: server/api.d.ts:1347
Creates a script wrapper for an existing prop with this ID; use Prop.create() to create a prop.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Prop
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”attachTo()
Section titled “attachTo()”attachTo(
target,offset?,rotation?):void
Defined in: server/api.d.ts:1405
Makes the prop follow a player or vehicle, stopping any moveTo. An attached prop has no collision and takes the target’s virtual world; it is released where it stands when the target is destroyed or disconnects.
Parameters
Section titled “Parameters”target
Section titled “target”Player or vehicle to follow, or its network entity ID.
offset?
Section titled “offset?”Optional position relative to the target, in its local axes (X right, Y forward, Z up). Defaults to the origin.
rotation?
Section titled “rotation?”Optional orientation relative to the target: a Quaternion, or a Vector3 of Euler angles in degrees.
Returns
Section titled “Returns”void
destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:1378
Destroys this replicated prop and removes it from connected clients.
Returns
Section titled “Returns”void
detach()
Section titled “detach()”detach():
void
Defined in: server/api.d.ts:1388
Releases an attached prop, leaving it at its target’s current pose.
Returns
Section titled “Returns”void
moveTo()
Section titled “moveTo()”moveTo(
position,durationMs,rotation?,easing?):void
Defined in: server/api.d.ts:1397
Glides the prop to a new pose, smoothly on every client, starting from where it is now. position and rotation report the destination at once; use isMoving to tell whether it has arrived. Throws while the prop is attached.
Parameters
Section titled “Parameters”position
Section titled “position”World-space destination.
durationMs
Section titled “durationMs”number
Travel time in milliseconds; 0 moves instantly. Capped at 10 minutes.
rotation?
Section titled “rotation?”Optional final orientation: a Quaternion, or a Vector3 of Euler angles in degrees. Defaults to the current orientation.
easing?
Section titled “easing?”"linear" | "inQuad" | "outQuad" | "inOutQuad"
Optional speed curve. Defaults to “linear”.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:4371
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:4377
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
void
Defined in: server/api.d.ts:1383
Halts a running moveTo where the prop is now.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:1373
Returns a readable representation of this prop.
Returns
Section titled “Returns”string
The prop ID formatted for logging or debugging.
Inherited from
Section titled “Inherited from”create()
Section titled “create()”
staticcreate(x,y,z,model,rotation?,collision?,virtualWorld?):Prop
Defined in: server/api.d.ts:1418
Creates and replicates a static world prop.
Parameters
Section titled “Parameters”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.
rotation?
Section titled “rotation?”Optional orientation: a Quaternion, or a Vector3 of Euler angles in degrees.
collision?
Section titled “collision?”boolean
Optional solidity; pass false to spawn a pass-through prop with no collision. Defaults to true.
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual-world ID used for visibility filtering.
Returns
Section titled “Returns”Prop
The newly created prop handle.
Properties
Section titled “Properties”attachedTo
Section titled “attachedTo”
readonlyattachedTo:number
Defined in: server/api.d.ts:1357
Network entity ID of the player or vehicle this prop follows; 0 when it is free.
collision
Section titled “collision”collision:
boolean
Defined in: server/api.d.ts:1367
Whether the prop is solid. Set false to make it pass-through for players, vehicles and physics.
readonlyid:number
Defined in: server/api.d.ts:4339
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”isMoving
Section titled “isMoving”
readonlyisMoving:boolean
Defined in: server/api.d.ts:1352
Whether a moveTo is still under way.
readonlymodel:number
Defined in: server/api.d.ts:1362
Mafia II model identifier used by this prop.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:4349
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:4354
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlystate:StateBag
Defined in: server/api.d.ts:4359
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:4344
Current virtual-world identifier.
