Skip to content

RiftScript capabilities

Capabilities are the safe verbs and questions a behavior can use. This page is generated from the same typed registry used by the compiler, completion menu, validator, and runtime. Open this in Workshop

score.add

RiftScript 1

What it does

Requests a score increase validated by the authoritative runtime.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
score.add(10);

Limits

  • Server-authoritative command.
  • Costs 1 creator operation.
  • Arguments: amount: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Amount is not finite.

effects.play

RiftScript 1

What it does

Emits a presentation effect from the approved project effect library.

When to use it

Use this for presentation that must not change scores, saves, or physics.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
effects.play("coin_pickup");

Limits

  • Presentation-only command.
  • Costs 1 creator operation.
  • Arguments: effect: string.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Effect name is not a bounded string.

audio.play

RiftScript 2

What it does

Requests presentation-only playback of the approved Audio Source attached to this object.

When to use it

Use this for presentation that must not change scores, saves, or physics.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
audio.play();

Limits

  • Presentation-only command.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • The object has no Audio Source or approved clip.

audio.stop

RiftScript 2

What it does

Stops presentation-only playback started by this object's Audio Source.

When to use it

Use this for presentation that must not change scores, saves, or physics.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
audio.stop();

Limits

  • Presentation-only command.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • The object has no Audio Source.

animation.play

RiftScript 2

What it does

Plays a named creator animation clip on this object as a bounded presentation command.

When to use it

Use this for presentation that must not change scores, saves, or physics.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
animation.play("door_open");

Limits

  • Presentation-only command.
  • Costs 1 creator operation.
  • Arguments: clip: string.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • The object has no creator animation with that clip name.

animation.stop

RiftScript 2

What it does

Stops a scripted creator animation override and returns the object to its automatic/default clip.

When to use it

Use this for presentation that must not change scores, saves, or physics.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
animation.stop();

Limits

  • Presentation-only command.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • The object has no creator animation.

world.destroy

RiftScript 1

What it does

Marks the script's owning entity inactive in the authoritative world.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
world.destroy();

Limits

  • Server-authoritative command.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Shared type, instruction, command, and operation-budget checks still apply.

player.launch

RiftScript 1

What it does

Sets the current player's bounded authoritative velocity from a sensor event.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
player.launch(0, -600);

Limits

  • Server-authoritative command.
  • Costs 1 creator operation.
  • Arguments: velocityX: number, velocityY: number.
  • Returns: nothing.
  • Events: player_touched, player_interacted.

Common problems

  • Called outside player_touched or player_interacted.
  • Velocity is zero, non-finite, or outside -2000…2000.

entity.self

RiftScript 2

What it does

Returns an opaque handle for the object running this behavior.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let me: entity = entity.self();

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: entity.
  • Events: any supported event.

Common problems

  • Shared type, instruction, command, and operation-budget checks still apply.

player.current

RiftScript 2

What it does

Returns the authoritative player that activated the current sensor event.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let player: entity = player.current();

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: entity.
  • Events: player_touched, player_interacted.

Common problems

  • Called outside a player sensor event.

entity.find

RiftScript 2

What it does

Returns the first active object with a tag, ordered by stable object ID.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let target: entity = entity.find("target");

Limits

  • Server-authoritative query.
  • Costs 4 creator operations.
  • Arguments: tag: string.
  • Returns: entity.
  • Events: any supported event.

Common problems

  • Tag is invalid.
  • No active object has the tag.

entity.exists

RiftScript 2

What it does

Checks whether a handle still identifies an active object.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
if (entity.exists(target)) { }

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: boolean.
  • Events: any supported event.

Common problems

  • Shared type, instruction, command, and operation-budget checks still apply.

entity.count

RiftScript 2

What it does

Counts active objects with one stable tag, including runtime-spawned prefab objects.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let enemies: number = entity.count("enemy");

Limits

  • Server-authoritative query.
  • Costs 4 creator operations.
  • Arguments: tag: string.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Tag is invalid.

entity.active

RiftScript 2

What it does

Reads whether an existing object is enabled.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let enabled: boolean = entity.active(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: boolean.
  • Events: any supported event.

Common problems

  • Handle does not exist.

transform.x

RiftScript 2

What it does

Reads an object's authoritative horizontal position.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let x: number = transform.x(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Transform does not exist.

transform.y

RiftScript 2

What it does

Reads an object's authoritative vertical position.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let y: number = transform.y(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Transform does not exist.

velocity.x

RiftScript 2

What it does

Reads an object's authoritative horizontal velocity.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let vx: number = velocity.x(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Rigidbody does not exist.

velocity.y

RiftScript 2

What it does

Reads an object's authoritative vertical velocity.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let vy: number = velocity.y(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Rigidbody does not exist.

world.spawn

RiftScript 2

What it does

Spawns one bounded approved project prefab and returns its root handle.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let spawned: entity = world.spawn("enemy", 100, 100);

Limits

  • Server-authoritative query.
  • Costs 8 creator operations.
  • Arguments: prefabId: string, x: number, y: number.
  • Returns: entity.
  • Events: any supported event.

Common problems

  • Prefab is missing or unsafe for runtime spawning.
  • Position or spawn quota is invalid.

score.value

RiftScript 2

What it does

Reads the current authoritative score so scripts can build thresholds and staged encounters.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let total: number = score.value();

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: none.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Shared type, instruction, command, and operation-budget checks still apply.

health.current

RiftScript 2

What it does

Reads an object's current authoritative health.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let hp: number = health.current(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Health component does not exist.

health.maximum

RiftScript 2

What it does

Reads an object's configured maximum health.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let maxHp: number = health.maximum(target);

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Health component does not exist.

inventory.count

RiftScript 2

What it does

Reads the authoritative quantity of one item in an object's Inventory.

When to use it

Use this when your behavior needs a trusted value before deciding what to do.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
let keys: number = inventory.count(player, "key");

Limits

  • Server-authoritative query.
  • Costs 1 creator operation.
  • Arguments: target: entity, itemId: string.
  • Returns: number.
  • Events: any supported event.

Common problems

  • Handle or Inventory component does not exist.
  • Item ID is invalid.

entity.destroy

RiftScript 2

What it does

Disables an existing object through an opaque handle.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
entity.destroy(target);

Limits

  • Server-authoritative command.
  • Costs 1 creator operation.
  • Arguments: target: entity.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle does not exist.

entity.set_active

RiftScript 2

What it does

Enables or disables an existing object.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
entity.set_active(target, false);

Limits

  • Server-authoritative command.
  • Costs 1 creator operation.
  • Arguments: target: entity, active: boolean.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle does not exist.

transform.set

RiftScript 2

What it does

Moves an object to a bounded authoritative world position.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
transform.set(target, 100, 100);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, x: number, y: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Transform does not exist.
  • Position is outside the world.

velocity.set

RiftScript 2

What it does

Sets a Rigidbody's bounded authoritative velocity.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
velocity.set(target, 120, -400);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, vx: number, vy: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Rigidbody does not exist.
  • Velocity is outside -2000…2000.

health.damage

RiftScript 2

What it does

Applies bounded authoritative damage through the standard health, death, loot, and respawn pipeline.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
health.damage(target, 10);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, amount: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Health component does not exist.
  • Amount is outside 0…100000.

health.heal

RiftScript 2

What it does

Restores bounded authoritative health without exceeding the object's maximum.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
health.heal(target, 10);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, amount: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Health component does not exist.
  • Amount is outside 0…100000.

inventory.add

RiftScript 2

What it does

Grants a bounded item stack through the standard authoritative inventory pipeline.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
inventory.add(player, "key", "Ancient Key", 1);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, itemId: string, label: string, quantity: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Inventory component does not exist.
  • Capacity, stack, item ID, label, or quantity is invalid.

inventory.remove

RiftScript 2

What it does

Consumes a bounded quantity from an authoritative inventory.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
inventory.remove(player, "key", 1);

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: target: entity, itemId: string, quantity: number.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Handle or Inventory component does not exist.
  • The requested quantity is unavailable or invalid.

timer.after

RiftScript 2

What it does

Schedules one named signal for this object after 1…3600 fixed ticks.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
timer.after(60, "ready");

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: ticks: number, signal: string.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Tick delay, signal name, or pending-timer quota is invalid.

signal.emit

RiftScript 2

What it does

Queues one named signal for this object on the next fixed tick.

When to use it

Use this when your behavior must request a trusted gameplay change.

How to add it

Open an object's Logic panel, create RiftScript, and choose the capability from completion. Compile before attaching.

Example

text
signal.emit("ready");

Limits

  • Server-authoritative command.
  • Costs 2 creator operations.
  • Arguments: signal: string.
  • Returns: nothing.
  • Events: any supported event.

Common problems

  • Signal name or pending-signal quota is invalid.

Trust model

Server capabilities affect authoritative state. Client capabilities only request bounded presentation. Browsers do not submit query results, scores, collisions, or save state. Creator source executes only as verified instructions in the controlled VM; JavaScript is never evaluated.

PixelRifts creator documentation · generated reference · protocol 21