Consumable item
Welcome to user guide to add items
If you want to create a new item which can be consumed, for example a new donut, or a new drink like a tea, remember to add this to your esx_basicneeds
if you use ESX
or, if you use QBCORE
in your case you must add it to your qb-smallresources
in config.lua
Remember that you can use the system that gives you our inventory, and also the resource that gives you ESX or QBCore natively, just be careful not to have consumable items with our system and in your resource of that either esx-basicneeds or qb-smallresources to avoid problems.
Step by step to create a usable item
This is an explanation for you to understand, it is not the example code, the example code will be up to the last thing for you to copy and use as an example, remember to change everything if you know what you are doing to your liking.
Please read carefully. In case of using qb-core, you must use your shared in qb-core, not this shared, this section is exclusive for esx!
Now proceed to make the consumable item, with this we will help the ['client'] that will give you the necessary functions with the values to enter in this configuration, where you can add a status, either hunger or thirst, the time of use, the animation, the prop, disable movements and if you want the item to be removed after use or not, is a nice and easy configuration that you can follow.
Example code
Now you are clear of every part of how to make a usable item, remember not to have this usable item in your esx_basicneed or qb-smallresources
, if you are creating it here too because it can cause you problems, the following code is an example of how the item would look like in your shared/items.lua
of utility.
Last updated