πͺ Furniture As Items
Furniture can be an inventory item. A player uses the item inside a property to place that piece. The item is removed once it's placed.
Requirements
- ox_inventory. Furniture items are created and removed through ox_inventory.
Setup
- 1
Add the item to ox_inventory
Add this item to
ox_inventory/data/items.lua. The item name must befurniture. Every item the script uses is on ox_inventory Items.ox_inventory/data/items.luaEach item gets its own label, photo, and weight from the furniture catalog when it is given.
- 2
Give the permission
The
/givefurniturecommand needs the Give furniture items permission. Grant it to a job grade in/manageagencies. See Real estate agencies.The command name is
GiveFurnitureCommandinconfig.lua. - 3
Give furniture
Example:
furnitureName is the object model of a piece in the furniture catalog. Find it in /properties β Furniture Catalog. If the model is not in the catalog, the command returns "Furniture not found".
Using the item
When a player uses the furniture item:
- Inside a property: placement starts right away.
- In a yard or MLO shared by several properties: a menu asks which property to place it in.
- Anywhere else: the player gets an error.
The player needs permission to manage the property's furniture. Placement is blocked in starter apartments when furniture is disabled for them, and during a police lockdown.
Item-exclusive furniture
A catalog piece can be marked Item exclusive in the Furniture Catalog. With FurnitureConfig.ItemExclusive = true in furniture.lua (the default), those pieces:
- are hidden from the furniture shop,
- can only be placed from an inventory item,
- can't be sold back for money.
Use this for furniture you hand out as rewards or sell elsewhere.
Export
Give furniture from another script, on the server: