AddKey

exports.nolag_properties:AddKey(playerId, propertyId, keyHolder)

Parameters

  • playerId: number | false | 0 The source of the request. Pass false or 0 for 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_keys permission.

  • If the caller is a renter (but not the owner), manage_property_settings and manage_property_renters locks are automatically stripped from the granted key.

  • The target must be online.

  • Both the caller and the target receive a notification.

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')