Kartik Scripts

GetNearbyProperties

exports['kartik-properties']:GetNearbyProperties(source, radius)

🔹 Description

Lists the properties whose entrance is near a player, closest first. Handy for police scripts that need to know which property an officer is standing at, for example before calling RaidProperty. An apartment building returns every unit at that entrance.


🔧 Parameters

NameTypeRequiredDescription
sourcenumber✅Server id of the player.
radiusnumber❌Search distance in metres. Defaults to Config.EntranceMaxDistance.

📤 Returns

A list (empty when nothing is near). Each entry:

FieldTypeDescription
idnumberProperty id.
labelstringProperty name.
lockedbooleanWhether the front door is locked.
ownerstring | nilCitizen id of the owner (nil for company or state owned).
tenantstring | nilCitizen id of the active tenant, if rented.
distancenumberDistance from the player to the entrance.

🧠 Example Usage

for _, p in ipairs(exports['kartik-properties']:GetNearbyProperties(source, 5.0)) do
    print(p.id, p.label, p.locked, p.owner)
end

On this page