Prop
Defined in: server/api.d.ts:3733
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:3738
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”destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:3774
Despawns this prop on every client after emitting propDestroy.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:8797
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:8803
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”toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:3769
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”
staticall():Prop[]
Defined in: server/api.d.ts:3792
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:3806
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:3799
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:3786
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:8765
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”
readonlymodel:string
Defined in: server/api.d.ts:3743
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:3753
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:3748
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:3758
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, and a rigid one is simulated separately by each of them with nothing reconciling it.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:8775
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:8780
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:3763
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:8785
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:8770
Current virtual-world identifier.