deleteProperty

Description

Triggered when a property is about to be deleted from the server.

Payload Structure

{
    deleter = deleter,        -- Identifier of who initiated the deletion
    propertyId = propertyId   -- Property identifier
}

Parameters

  • deleter (string): Identifier of the user who initiated deletion, or Server

  • propertyId (number): Unique identifier for the property being deleted

Usage Example

exports.nolag_properties:registerHook('deleteProperty', function(data)
    print(('Deleting property %s by %s'):format(data.propertyId, data.deleter))

    -- Prevent deletion based on custom rules
    if not canDeleteProperty(data.deleter, data.propertyId) then
        return false -- Cancel the deletion
    end

    return true -- Allow the deletion to proceed
end)

Return Values

  • true or nil: Allow the property deletion to continue

  • false: Cancel the deletion and prevent the property from being removed

Last updated