Furniture Interactions
info
In order to use furniture interactions you need to configure interact.
You can add interactions based on furniture models or tags.
Types
Interaction
| Field | Type | Description | Required |
|---|---|---|---|
| id | string | Unique id for the interaction | true |
| label | string | Interaction label to show | true |
| onInteract | function | Function to execute on interact | true |
| tags | string[] | Furniture tags | false |
| models | number[] | Furniture models | false |
| icon | string | Font Awesome icon | false |
| accessRequired | boolean | Controls whether the player has access to the house for interact. Default: true | false |
Examples
Config.FurnitureInteractions = {
{
id = "stash",
tags = {"stash"},
label = "Stash",
icon = "box",
onInteract = function(entity, furnitureId, houseId)
local stash = "housing:furniture:stash:" .. houseId .. ":" .. furnitureId
-- OPEN STASH
TriggerEvent("inventory:open", stash)
end
},
{
id = "clothing",
tags = {"clothing"},
label = "Clothes",
icon = "shirt",
accessRequired = false,
onInteract = function(entity, furnitureId, houseId)
TriggerEvent("clothing:open")
end
}
}