AddKey
luaexports.nolag_properties:AddKey(playerId, propertyId, keyHolder)
Parameters
- playerId:
number | false | 0
The source of the request. Passfalseor0for server-side execution (bypasses player validation, permission checks, and allows the target to be offline). - propertyId:
number
The property ID. - keyHolder:
string
The identifier of the player to receive the key.
Return Value
boolean- Whether the key was added or not.
Behavior
- The calling player must have the
manage_property_keyspermission. - If the caller is a renter (but not the owner),
manage_property_settingsandmanage_property_renterslocks are automatically stripped from the granted key. - The target must be online.
- Both the caller and the target receive a notification.
- No permission checks are performed.
- The target does not need to be online - the identifier is stored directly.
- Only the target receives a notification (if they are online).
Example
Player-initiated call
local success = exports.nolag_properties:AddKey(source, 1, 'license:xxxx')Server-side call (no player context)
local success = exports.nolag_properties:AddKey(false, 1, 'license:xxxx')