Prop
Defined in: server/api.d.ts:4031
Replicated static mesh handle.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Prop(
id):Prop
Defined in: server/api.d.ts:4036
Creates a script wrapper for an existing prop with this ID; use Prop.spawn() to spawn one.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Prop
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”applyImpulse()
Section titled “applyImpulse()”applyImpulse(
impulse,point?,angularImpulse?):boolean
Defined in: server/api.d.ts:4086
Pushes a rigid prop’s body and wakes it. The nearest player’s client simulates the body and every other player sees the pose it streams. propRest is raised once it stops.
Parameters
Section titled “Parameters”impulse
Section titled “impulse”The push in kg m/s, world space. The body’s velocity changes by this divided by its mass, so a heavy prop needs a large number.
point?
Section titled “point?”Where the push lands, in world space. Off the centre of mass it also turns the body, which is what topples a tall one. Omitted, it lands on the centre of mass.
angularImpulse?
Section titled “angularImpulse?”A twist on top, in kg m^2/s about each world axis.
Returns
Section titled “Returns”boolean
True when it was sent to the client simulating the prop; false when the prop is gone or is not rigid, a value is not finite or is out of range, or no player is within 60 m to simulate it.
destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:4077
Despawns this prop on every client after emitting propDestroy.
Returns
Section titled “Returns”void
resetPhysics()
Section titled “resetPhysics()”resetPhysics():
boolean
Defined in: server/api.d.ts:4112
Stops a rigid prop’s body and puts it back where it was spawned, for every player. Raises no propRest.
Returns
Section titled “Returns”boolean
True when it was put back; false when the prop is gone or is not rigid.
setVelocity()
Section titled “setVelocity()”setVelocity(
velocity,angularVelocity?):boolean
Defined in: server/api.d.ts:4094
Sets a rigid prop’s velocity outright, whatever its mass, and wakes it. propRest is raised once it stops.
Parameters
Section titled “Parameters”velocity
Section titled “velocity”Its new velocity in m/s, world space, up to 200.
angularVelocity?
Section titled “angularVelocity?”Its new spin in radians per second about each world axis, up to 100. Omitted, it stops turning.
Returns
Section titled “Returns”boolean
True when it was sent to the client simulating the prop; false when the prop is gone or is not rigid, a value is not finite or is out of range, or no player is within 60 m to simulate it.
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:9890
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:9896
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”sleep()
Section titled “sleep()”sleep():
boolean
Defined in: server/api.d.ts:4106
Stops a rigid prop’s body where it is, in mid-air if need be. It wakes again when something hits it or a script moves it. propRest then reports where it stopped. To fix a prop in place for good, set physics to static once propRest has been raised.
Returns
Section titled “Returns”boolean
True when it was sent to the client simulating the prop; false when the prop is gone or is not rigid, a value is not finite or is out of range, or no player is within 60 m to simulate it.
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:4072
Formats this prop handle for logging and debugging.
Returns
Section titled “Returns”string
The prop ID, its model, its physics and its scale.
Inherited from
Section titled “Inherited from”wake()
Section titled “wake()”wake():
boolean
Defined in: server/api.d.ts:4100
Starts a resting rigid prop simulating where it lies, so it falls if nothing holds it up. propRest is raised once it stops.
Returns
Section titled “Returns”boolean
True when it was sent to the client simulating the prop; false when the prop is gone or is not rigid, a value is not finite or is out of range, or no player is within 60 m to simulate it.
staticall():Prop[]
Defined in: server/api.d.ts:4130
Lists every prop the server currently has.
Returns
Section titled “Returns”Prop[]
One handle per live prop, in no particular order.
destroyAll()
Section titled “destroyAll()”
staticdestroyAll(virtualWorld?):number
Defined in: server/api.d.ts:4144
Despawns props, emitting propDestroy for each one.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world to clear; omitted clears every one of them.
Returns
Section titled “Returns”number
How many props were removed.
getById()
Section titled “getById()”
staticgetById(id):Prop|null
Defined in: server/api.d.ts:4137
Looks a prop up by its network entity ID.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Prop | null
The prop’s handle, or null when no live prop has that ID.
spawn()
Section titled “spawn()”
staticspawn(model,position?,rotation?,scale?,physics?,virtualWorld?):Prop
Defined in: server/api.d.ts:4124
Spawns and replicates a static mesh from the game’s own object catalog.
Parameters
Section titled “Parameters”string
Mesh to build, as either a full catalog path (objects/manmade/barrels/barrel_a.cgf) or its file stem (barrel_a). A stem several meshes share resolves to the first of them, so pass the path when it matters which. A mesh this server streams – a .cgf in a resource’s stream/objects/kcdc/<resource>/ folder – is named by its full path, objects/kcdc/<resource>/chair.cgf; a player whose game does not have it yet sees the prop as soon as it does.
position?
Section titled “position?”Optional world-space spawn position; omitted components default to zero.
rotation?
Section titled “rotation?”Optional initial orientation: a Quaternion, or a Vector3 of Euler angles in degrees.
scale?
Section titled “scale?”number | Vector3
Uniform size or separate X/Y/Z sizes, each from 0.01 to 100. Omitted uses the mesh size. Nonuniform collision follows the native engine limitations.
physics?
Section titled “physics?”string
Optional collision: static (the default), rigid or none.
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world the prop belongs to; omitted puts it in the global one.
Returns
Section titled “Returns”Prop
The newly spawned prop handle.
Properties
Section titled “Properties”
readonlyid:number
Defined in: server/api.d.ts:9858
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”mass:
number
Defined in: server/api.d.ts:4061
A rigid prop’s mass in kilograms, given to its body as it is built; 0, the default, takes the mass the mesh’s collision gives it. Up to 100,000; a value outside 0 to 100,000 is ignored. Set it for a mesh whose collision carries no mass, such as a tree’s: without one, every client builds such a prop as a static one, which stands still and cannot be pushed, and logs why. Assignment rebuilds the prop on every client, so set it before pushing it.
readonlymodel:string
Defined in: server/api.d.ts:4041
Catalog path of the mesh this prop was built from, e.g. objects/manmade/barrels/barrel_a.cgf. Read-only: the collision is built from the mesh when the entity is spawned and never re-read, so a prop is the model it was created with.
modelGroup
Section titled “modelGroup”
readonlymodelGroup:string
Defined in: server/api.d.ts:4051
Browsing bucket the mesh sits in, e.g. manmade/structures; kcdc/<resource> for a mesh the server streams.
modelName
Section titled “modelName”
readonlymodelName:string
Defined in: server/api.d.ts:4046
File stem of the mesh, e.g. barrel_a, which is the short name Prop.spawn also accepts.
physics
Section titled “physics”physics:
string
Defined in: server/api.d.ts:4056
What this prop’s collision does: static collides but never moves, rigid falls and can be pushed, none has none at all. Assignment rebuilds the prop on every client. A rigid one is simulated by the nearest player’s client within 60 m, and every other player sees the pose it streams; with nobody that near, it stays where it last rested.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:9868
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:9873
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”scale:
number
Defined in: server/api.d.ts:4066
Uniform scale, from 0.01 to 100; a value outside that is clamped into it. Assignment rebuilds the prop on every client, because the collision is sized from the scale at spawn and never re-read.
readonlystate:StateBag
Defined in: server/api.d.ts:9878
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:9863
Current virtual-world identifier.