Portable Benches
Learn how to set up portable benches.
Setting Up Portable Benches
-
Open
config.lua
in the resource folder. -
Find the
BenchOptions
section: -
Change
enablePortableBenches
totrue
. -
Save the file and restart the resource.
-
Navigate to your inventory resource (or item configuration), and add the following item:
(Example for QBCore. Configuration may vary depending on your inventory resource. The item name must be
crafting_bench
and must be unstackable.) -
Save the file and restart the resource.
Players can now place benches using the crafting_bench
item.
Dynamic Portable Bench Items
To create a more dynamic item system, items can be linked to specific bench types. This allows items to have unique variations based on their bench type association.
For example, Police
bench type should be stored as:
This system ensures that bench types can define item properties dynamically.
How the Search Function Works
In our script, everything before _crafting_bench
acts as a search key. This means when searching for an item, the script will recognize police
as the base item and match it to the police_crafting_bench
. This allows easy categorization and retrieval of bench type linked items.
Giving the Item
To give the item to a player:
- Open the editor and click the "Give item" button on the desired bench type.
- Use one of the resource's commands.
- Use one of the resource's exports.
Item Image
You can use the following image for the item in your inventory:

Developer Note
The item must include metadata like this:
Replace UUID
with the desired bench type UUID, which can be found in the editor.