Kartik Scripts

GetAllProperties

exports['kartik-properties']:GetAllProperties()

๐Ÿ”น Description

Returns a global registry of every known property, owned, company-held, state stock and listed, as normalised shaped property records. Useful for a server-wide property directory or a "for sale" board in an external UI.


๐Ÿ”ง Parameters

None.


๐Ÿ“ค Returns

TypeDescription
table[]Array of shaped property records for every property.

๐Ÿง  Example Usage

local all = exports['kartik-properties']:GetAllProperties()

local forSale = {}
for _, p in ipairs(all) do
    if p.listing == 'for_sale' then
        forSale[#forSale + 1] = p
    end
end

print(('%d properties listed for sale'):format(#forSale))

๐Ÿ“Œ Notes

  • Reads directly from the property cache, no database round-trip.
  • On a large server this can return a lot of rows; cache the result if you call it frequently.

On this page