Portable Benches
Learn how to set up portable benches.
Learn how to set up portable benches.
Open config.lua in the resource folder.
Find the BenchOptions section:
Change enablePortableBenches to true.
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.
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.
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.
To give the item to a player:
You can use the following image for the item in your inventory:
The item must include metadata like this:
Replace UUID with the desired bench type UUID, which can be found in the editor.