Kartik Scripts

RevokeHousingKey

exports['kartik-properties']:RevokeHousingKey(propertyId, targetCid, revokedByCid)

🔹 Description

Revokes access for a citizen holding a key to a specific property. Cleans up property keys, resets rent split records, and logs an audit entry.


🔧 Parameters

NameTypeRequiredDescription
propertyIdnumber | string✅Property ID from which access is being removed.
targetCidstring✅Citizen ID whose key is being revoked.
revokedByCidstring❌Citizen ID performing the revocation (defaults to 'phone').

📤 Returns

TypeDescription
tableResult table { success = true/false }.

🧠 Example Usage

local result = exports['kartik-properties']:RevokeHousingKey(12, 'XYZ98765', 'ABC12345')

if result.success then
    print('Key successfully revoked!')
end

On this page