CyberM.doors

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

client runtime23 functionsMarkdown

aimed

GAME

CyberM.doors.aimed()

The streamed door currently under the crosshair.

Requires world.doors. The returned id is an opaque 64-bit REDengine identity encoded as a string; never convert it to a Lua number. A successful discovery also makes that door addressable by state and the command functions while it remains streamed.

Returns

  • door snapshot, or nil
  • reason when the first is nil

Example

local door, reason = CyberM.doors.aimed()
if door then
    print(door.id, door.open, door.locked, door.distance)
end

Registered in ResourceHost.cpp as LuaDoorAimed (line 6647).

CyberM.doors.available()

Whether the client door backend is available.

This capability check does not discover or stream a door. Door operations require the world.doors permission.

Returns

  • boolean

Registered in ResourceHost.cpp as LuaDoorsAvailable (line 6646).

CyberM.doors.clearInteractionPolicy(door)

Removes this resource's interaction policy for a door.

Requires world.doors. Other resources' policies are unaffected.

Parameters

  • dooropaque door idrequired

Returns

  • true on success, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorPolicy (line 6676).

close

GAME

CyberM.doors.close(door, [force])

Closes a door.

Alias of setOpen(door, false, force). Requires world.doors; application is asynchronous.

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6662).

CyberM.doors.closest([radius])

The closest streamed door around the local player.

Requires world.doors. Uses the same 0.5 to 100 metre player-centered query as near.

Parameters

  • radiusnumberoptionaldefault 20

Returns

  • door snapshot, or nil
  • reason when the first is nil

Registered in ResourceHost.cpp as LuaDoorClosest (line 6649).

CyberM.doors.grantKey(door, holder)

Grants an entity an opening token for a door.

Requires world.doors. Uses the door controller's native token mechanism rather than a parallel CyberM key list. This grants authorization but does not lock or deny an otherwise usable door; access enforcement belongs to setInteractionAllowed.

Parameters

  • dooropaque door idrequired
  • holderopaque entity idrequired

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6671).

hasKey

GAME

CyberM.doors.hasKey(door, holder)

Whether an entity holds an opening token for a door.

Requires world.doors.

Parameters

  • dooropaque door idrequired
  • holderopaque entity idrequired

Returns

  • boolean, or nil
  • reason when the first is nil

Registered in ResourceHost.cpp as LuaDoorHasKey (line 6652).

CyberM.doors.holders(door)

The entities holding an opening token for a door.

Requires world.doors. Holder IDs are opaque strings for the same precision reason as door IDs. Tokens are vanilla authorization data, not a global lock rule: an unlocked interactive door remains usable with no token. Combine hasKey with setInteractionAllowed when implementing an ox_doorlock-style policy.

Parameters

  • dooropaque door idrequired

Returns

  • array of opaque entity ids, or nil
  • reason when the first is nil

Registered in ResourceHost.cpp as LuaDoorHolders (line 6651).

lock

GAME

CyberM.doors.lock(door, [force])

Locks a door.

Alias of setLocked(door, true, force).

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6664).

near

GAME

CyberM.doors.near([radius])

All streamed doors around the local player.

Requires world.doors. The radius is centered on the player and must be between 0.5 and 100 metres. Results are sorted nearest first and register each door for later ID-based operations.

Parameters

  • radiusnumberoptionaldefault 20

Returns

  • array of door snapshots, or nil
  • reason when the first is nil

Registered in ResourceHost.cpp as LuaDoorNear (line 6648).

open

GAME

CyberM.doors.open(door, [force])

Opens a door.

Alias of setOpen(door, true, force). Requires world.doors; application is asynchronous.

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6661).

reset

GAME

CyberM.doors.reset(door)

Resets a door to its configured default state.

Requires world.doors; queues the vanilla ResetDoorState event.

Parameters

  • dooropaque door idrequired

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6670).

CyberM.doors.revokeKey(door, holder)

Revokes an entity's opening token for a door.

Requires world.doors.

Parameters

  • dooropaque door idrequired
  • holderopaque entity idrequired

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6672).

seal

GAME

CyberM.doors.seal(door, [force])

Seals a door.

Alias of setSealed(door, true, force).

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6667).

CyberM.doors.setAutomaticClose(door, enabled)

Enables or disables a door's automatic closing behavior.

Requires world.doors; queues the vanilla SetCloseItself event.

Parameters

  • dooropaque door idrequired
  • enabledbooleanrequired

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6669).

CyberM.doors.setInteractionAllowed(door, allowed)

Pre-declares whether vanilla interaction may open a door.

Requires world.doors. The decision is synchronous when the game interacts with the door. Policies are owned by the resource, all active policies must allow, and they are removed automatically on stop/reload. cyberm:doorInteract is an observational event with (doorId, activatorId, "true"|"false"); it is too late to change that interaction.

Parameters

  • dooropaque door idrequired
  • allowedbooleanrequired

Returns

  • true on success, otherwise false
  • reason for refusal

Example

CyberM.doors.setInteractionAllowed(doorId, playerHasAccess)
AddEventHandler("cyberm:doorInteract", function(door, activator, allowed)
    print(door, activator, allowed)
end)

Registered in ResourceHost.cpp as LuaDoorPolicy (line 6674).

CyberM.doors.setLocked(door, locked, [force])

Sets whether a door is locked.

Requires world.doors. force uses the vanilla quest-authority action; application is asynchronous.

Parameters

  • dooropaque door idrequired
  • lockedbooleanrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6663).

CyberM.doors.setOpen(door, open, [force])

Sets whether a door is open.

Requires world.doors. Success means the REDscript action was accepted; application is asynchronous and may take up to 200 ms. force uses the vanilla quest-authority action.

Parameters

  • dooropaque door idrequired
  • openbooleanrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6660).

CyberM.doors.setSealed(door, sealed, [force])

Sets whether a door is sealed.

Requires world.doors. Sealing is distinct from locking. force uses the vanilla quest-authority action.

Parameters

  • dooropaque door idrequired
  • sealedbooleanrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6666).

CyberM.doors.setState(door, state, [force])

Sets a door state by name.

Accepted states: open, closed, locked, unlocked, sealed, unsealed. Requires world.doors; force selects the quest-authority action.

Parameters

  • dooropaque door idrequired
  • statestringrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorSetState (line 6673).

state

GAME

CyberM.doors.state(door)

A live snapshot of a streamed door.

Requires world.doors. Reads the live DoorControllerPS, never a fabricated default from the save record. Returns door_not_streamed after the entity unloads. Snapshot fields include id, class, name, position, distance, open, closed, locked, sealed, busy, playerAuthorised, automaticClose, toggle capabilities, shutter/lift flags, type/sides and opening speed/time.

Parameters

  • dooropaque door idrequired

Returns

  • door snapshot, or nil
  • reason when the first is nil

Registered in ResourceHost.cpp as LuaDoorState (line 6650).

unlock

GAME

CyberM.doors.unlock(door, [force])

Unlocks a door.

Alias of setLocked(door, false, force).

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6665).

unseal

GAME

CyberM.doors.unseal(door, [force])

Unseals a door.

Alias of setSealed(door, false, force).

Parameters

  • dooropaque door idrequired
  • forcebooleanoptional

Returns

  • true when accepted, otherwise false
  • reason for refusal

Registered in ResourceHost.cpp as LuaDoorCommand (line 6668).

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