SetWorldDoorKey
setWorldDoorKey
Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated server and clients.
Server Lua. Part of custom keys and shared placed doors.
Syntax
ok, error = setWorldDoorKey(id, item)
Parameters and behavior
id identifies an owned placed door. item is an active canonical custom key from this or another resource. Assigns the key and enables its lock. One key type can open multiple doors; at least one authoritative copy is required and is not consumed.
Returns
true, empty error on success; false, error string otherwise. Locking does not close an open door. An actual rule change queues onWorldDoorLockChange.
Examples and security
See Custom keys for complete registration, copy issuance, placement, persistence and callback examples. These are server functions, not client RPC endpoints. Do not forward untrusted client arguments without gameplay authorization.