Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Runtime classServer APIGenerated

Prop

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

Replicated static mesh handle.

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.

number

Network entity identifier.

Prop

Entity.constructor

destroy(): void

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

Despawns this prop on every client after emitting propDestroy.

void


setVirtualWorld(world): void

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

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

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

Formats this prop handle for logging and debugging.

string

The prop ID, its model, its physics and its scale.

Entity.toString


static all(): Prop[]

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

Lists every prop the server currently has.

Prop[]

One handle per live prop, in no particular order.


static destroyAll(virtualWorld?): number

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

Despawns props, emitting propDestroy for each one.

number

Optional virtual world to clear; omitted clears every one of them.

number

How many props were removed.


static getById(id): Prop | null

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

Looks a prop up by its network entity ID.

number

Network entity identifier.

Prop | null

The prop’s handle, or null when no live prop has that ID.


static spawn(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.

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.

Vector3 | Partial<Vector3>

Optional world-space spawn position; omitted components default to zero.

Vector3 | Quaternion

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

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.

string

Optional collision: static (the default), rigid or none.

number

Optional virtual world the prop belongs to; omitted puts it in the global one.

Prop

The newly spawned prop handle.

readonly id: number

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

Immutable network entity identifier.

Entity.id


readonly model: 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.


readonly modelGroup: 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.


readonly modelName: 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: 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: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


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.

Entity.rotation


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.


readonly state: 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.

Entity.state


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld