CyberM.character

Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.

client runtime18 functionsMarkdown

CyberM.character.animation([entity])

The animation currently playing on this character.

Reads the current animation snapshot for an entity, or for the local player when omitted. The result is observational and can change on the next frame; it does not grant animation ownership.

Parameters

  • entityentityoptional

Returns

  • clip name, or nil

Registered in ResourceHost.cpp as LuaCharacterAnimation (line 6615).

CyberM.character.groundSpeed([entity])

Speed projected on the ground, without the vertical component.

Returns horizontal movement speed for the selected character, excluding vertical velocity. Entity ids refer to the current client stream and must not be persisted as server identity.

Parameters

  • entityentityoptional

Returns

  • number

Registered in ResourceHost.cpp as LuaCharacterNumber<&SelectGroundSpeed> (line 6617).

health

GAME

CyberM.character.health([entity])

Current health.

Reads the engine-side health visible for the selected character on this client. For replicated player gameplay rules use the server-authoritative player health APIs; this helper is a presentation snapshot, not authority.

Parameters

  • entityentityoptional

Returns

  • number

Registered in ResourceHost.cpp as LuaCharacterNumber<&SelectHealth> (line 6618).

CyberM.character.isAlive([entity])

Whether the character is alive.

Reports the current engine alive/dead flag for the selected character. It is useful for presentation and diagnostics but may lag the authoritative server health transition by a replication frame.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectAlive> (line 6620).

CyberM.character.isArmed([entity])

Whether a weapon is drawn.

Reports whether the selected character is currently considered armed by the game presentation state. It does not enumerate inventory or prove that a weapon action is server-authorized.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectArmed> (line 6625).

CyberM.character.isCrouched([entity])

Whether the character is crouching.

Reads the character's current crouch presentation flag. Omit the entity to inspect the local player; remote values exist only while that proxy is streamed.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectCrouched> (line 6622).

CyberM.character.isDriver([entity])

Whether they occupy the driver's seat.

Returns whether the selected character occupies the canonical driver seat of a vehicle. Use seat() when the exact seat and vehicle entity are also needed.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectDriverSeat> (line 6627).

CyberM.character.isEmoting([entity])

Whether they hold a workspot (an emote is running).

Reports whether CyberM currently presents the character in an emote/workspot state. This is a transient local snapshot and is cleared with the owning presentation lifecycle.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectInWorkspot> (line 6628).

CyberM.character.isGrounded([entity])

Whether the character is touching the ground.

Reads the engine grounded flag for the selected character. The value is sampled from the current client frame and should not be used alone for authoritative movement validation.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectGrounded> (line 6621).

CyberM.character.isInVehicle([entity])

Whether the character is mounted in a vehicle.

Reports whether the character is mounted in a vehicle according to the current client presentation. Call seat() to retrieve the mounted slot and vehicle entity id.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectInVehicle> (line 6626).

CyberM.character.isSliding([entity])

Whether the character is sliding.

Reads the current sliding locomotion flag for the selected character. It is an observational state and does not start or stop a slide.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectSliding> (line 6623).

CyberM.character.isVaulting([entity])

Whether the character is vaulting.

Reads the current vaulting locomotion flag for the selected character. Remote values are available only while the corresponding proxy is streamed.

Parameters

  • entityentityoptional

Returns

  • boolean

Registered in ResourceHost.cpp as LuaCharacterFlag<&SelectVaulting> (line 6624).

CyberM.character.position([entity])

The character's position.

Returns the character's current world-space coordinates from the game-thread snapshot. Omit the entity for the local player; do not persist a client entity id as a network identity.

Parameters

  • entityentityoptional

Returns

  • x, y, z

Registered in ResourceHost.cpp as LuaCharacterPosition (line 6612).

seat

GAME

CyberM.character.seat([entity])

The seat occupied in a vehicle, if any.

Returns the canonical seat name and the mounted vehicle's client entity id when the character is in a vehicle. A character that is not mounted returns nil; both values are snapshots and the entity id is valid only in the current client stream.

Parameters

  • entityentityoptional

Returns

  • seat name and vehicle entity id, or nil
  • reason when the character could not be read

Registered in ResourceHost.cpp as LuaCharacterSeat (line 6613).

speed

GAME

CyberM.character.speed([entity])

Instantaneous speed, all components.

Returns total character movement speed, including vertical motion, from the latest local snapshot. Use groundSpeed() when only horizontal locomotion is relevant.

Parameters

  • entityentityoptional

Returns

  • number

Registered in ResourceHost.cpp as LuaCharacterNumber<&SelectSpeed> (line 6616).

state

GAME

CyberM.character.state([entity])

One complete snapshot of a character.

A single engine pass fills the whole record even when the caller only wanted the speed. That is deliberate: every field then describes the same instant, so a caller cannot see a body grounded and airborne in the same breath. With no argument, answers about the local player.

Parameters

  • entityentityoptional

Returns

  • table { isPlayer, attached, id, engineId, position, orientation, forward, velocity, speed, groundSpeed, yaw, alive, health, grounded, crouched, sliding, vaulting, air, fall, landing, weapon…, inVehicle, seat, driver }
  • reason, when the first is nil

Example

local s = CyberM.character.state()
if s.inVehicle and s.driver then
    print("driving at " .. math.floor(s.speed) .. " u/s")
end

Registered in ResourceHost.cpp as LuaCharacterState (line 6611).

weapon

GAME

CyberM.character.weapon([entity])

The equipped weapon and its state.

Returns the drawn weapon's recognized item id and category for the selected character. It returns nil when no recognized weapon is currently presented and does not expose or mutate inventory.

Parameters

  • entityentityoptional

Returns

  • table { itemId, category }, or nil
  • reason when the character could not be read

Registered in ResourceHost.cpp as LuaCharacterWeapon (line 6614).

yaw

GAME

CyberM.character.yaw([entity])

Horizontal orientation, in degrees.

Returns the selected character's current world yaw in degrees. The value is a presentation snapshot and should be normalized by the caller when computing angular deltas.

Parameters

  • entityentityoptional

Returns

  • number

Registered in ResourceHost.cpp as LuaCharacterNumber<&SelectYaw> (line 6619).

For agents and LLMs: this page as Markdown · llms.txt · llms-full.txt