Esc to clear, Enter to open the best match, click an export to open it in its page
Properties & Doors

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

GetProperty(propertyId)SERVER#

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.

Returns: table|nil
GetProperties()SERVER#

Every property, as clients see them (no keyholders, doors or settings).

Returns: table[]
GetPropertyAt(x, y, z)SERVER#

The property whose space holds this point, or nil. Takes a vector3 too.

Returns: table|nil
GetCharacterProperties(charId)SERVER#

The property ids a character owns and holds keys to.

Returns: { owned = {...}, keys = {...} }

Owners and keys

HasPropertyAccess(propertyId, who)SERVER#

Whether a person is the property's owner or a keyholder.

Returns: true, or false, why ('No key to that property', 'No such property')
SetPropertyOwner(propertyId, who)SERVERWAITS#

Gives a property to a person; nil or false makes it unowned. A new owner takes back every key and locks the doors.

Returns: 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
GivePropertyKey / RemovePropertyKey(propertyId, who)SERVERWAITS#

Gives a person a key, or takes it back, without the in-game face-to-face rule.

Returns: boolean, string|nil ('They already have a key')

Furniture and stashes

GetPropertyStashes(propertyId)SERVER#

A property's stashes in the order they were made, each { containerId, name, slots, maxWeight, x, y, z }. containerId works with the container calls.

Returns: table[], empty for none

Themes

GetPropertyThemes(propertyId)SERVER#

A property's looks, or nil when its interior has none. label names the resource they come from.

Returns: { label, current, themes = { { id, name, walls, trim, floor }, ... } } or nil
SetPropertyTheme(propertyId, themeId)SERVERWAITS#

Gives a property one of its looks, with no check on who asks. It's saved, then the interior's resource redraws the home.

Returns: boolean, string|nil ('That is not one of its themes')

Property packs

RegisterPropertyPack(pack)SERVERWAITS#

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.

Returns: boolean ok, string: 'applied', 'unchanged', 'queued' (WHIP still starting), or 'path: why'
Applying it again is free. An identical pack writes nothing; a changed one only moves what the pack set. Owners, keys, furniture and admin changes are never touched, and a home an admin deleted isn't remade.
GetPropertyPacks()SERVER#

The packs WHIP knows (id, resource, version, label, running) and the pack files it refused (file, error).

Returns: { packs = {...}, problems = {...} }

Client

GetCurrentProperty()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.

Returns: { id, name, label, building, ownerCharId, mine, key } or nil
GetInteriorFurnishState(interiorId)CLIENT#

How 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 after whip_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 beyond PropertyFurnitureDistance or not among the PropertyFurnitureRooms nearest.
Returns: '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

RegisterProps(list)SERVERWAITS#

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.

Returns: 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' },
})
IsPlaceableProp(model)SERVER#

Whether a prop may be placed: false for an unknown model or one marked unavailable. Check it before placing a model a client named.

ParamTypeDescription
modelstringProp model name, any case
Returns: boolean