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
| Type | Description |
|---|---|
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.