Properties API
Exports for properties, their furniture and the placeable-prop catalogue. New to properties? Read Properties & Homes first. A who is a person: a server id, or { charId = n }.
Reading
One property: name, owner, placement, space, signs, keyholders (keys), doors (doorIds), settings, private garage (garageKey) and status ('ok' | 'unverified' | 'attention', with statusReason). WhipProperty in types/server.lua lists every field.
table|nilEvery property, as clients see them (no keyholders, doors or settings).
table[]The property whose space holds this point, or nil. Takes a vector3 too.
table|nilThe property ids a character owns and holds keys to.
{ owned = {...}, keys = {...} }Owners and keys
Whether a person is the property's owner or a keyholder.
true, or false, why ('No key to that property', 'No such property')Gives a property to a person; nil or false makes it unowned. A new owner takes back every key and locks the doors.
boolean, string|nil-- A sale: the money first, then the house, or the money back
local receipt, err = exports.whip_core:ChargePlayer(buyerSource, price, { method = 'bank', reason = 'House' })
if not receipt then return false, err end
local ok, why = exports.whip_core:SetPropertyOwner(propertyId, buyerSource)
if not ok then exports.whip_core:RefundPlayer(receipt) return false, why end
Gives a person a key, or takes it back, without the in-game face-to-face rule.
boolean, string|nil ('They already have a key')Furniture and stashes
A property's stashes in the order they were made, each { containerId, name, slots, maxWeight, x, y, z }. containerId works with the container calls.
table[], empty for noneThemes
A property's looks, or nil when its interior has none. label names the resource they come from.
{ label, current, themes = { { id, name, walls, trim, floor }, ... } } or nilGives a property one of its looks, with no check on who asks. It's saved, then the interior's resource redraws the home.
boolean, string|nil ('That is not one of its themes')Property packs
Registers an MLO's homes from a script, from the table a whip_property_pack file returns (format in whip_core/docs/properties.md); most MLOs only need the manifest line. The pack belongs to your resource and is checked whole: the first mistake refuses it.
boolean ok, string: 'applied', 'unchanged', 'queued' (WHIP still starting), or 'path: why'The packs WHIP knows (id, resource, version, label, running) and the pack files it refused (file, error).
{ packs = {...}, problems = {...} }Client
The property the local player stands in, or nil; key means this character holds a key. whip_core:property:entered and :exited fire as it changes.
{ id, name, label, building, ownerCharId, mine, key } or nilHow far along WHIP's furniture is for the property an interior stands on, for a resource that covers the windows until the room is finished. Ask a few times a second, or listen for whip_core:property:furnishStateChanged.
'pending': WHIP will make it, or remake it afterwhip_core:interiorRefreshed, and it isn't up yet.'done': it's up, or the furnisher has the room open.'none': nothing to wait for (no saved furniture, or not a property's interior).'idle': it has furniture, but beyondPropertyFurnitureDistanceor not among thePropertyFurnitureRoomsnearest.
'pending' | 'done' | 'none' | 'idle'local ok, state = pcall(function() return exports.whip_core:GetInteriorFurnishState(interiorId) end)
if not ok or state == 'done' or state == 'none' then
-- reveal the room
end
Prop catalogue
Adds a pack's props to the furnisher while it runs, with your pictures (list them in your files { }). Each call is the whole list; all go when the pack stops. A model WHIP already lists keeps its row and admin choices, and takes your picture.
true, or false, why (a category not in Config.PropCategories, a picture not in your resource, a model another pack registered)exports.whip_core:RegisterProps({
{ model = 'mypack_armchair', name = 'Velvet armchair', category = 'seating', image = 'img/armchair.webp' },
})
Whether a prop may be placed: false for an unknown model or one marked unavailable. Check it before placing a model a client named.
| Param | Type | Description |
|---|---|---|
| model | string | Prop model name, any case |
boolean