How to Add an Item
To add a new item to your FiveM server, you need to modify specific files based on the inventory system you’re using. These files are located in the [items] directory within your script. Follow the instructions below based on your inventory system.
For qb-core and qb-inventory
qb-core and qb-inventoryIf you’re using qb-core and qb-inventory, you need to edit the qb-core/shared/items.lua file.
Steps to Modify:
Locate the
[items]Directory:Connect to your server files via FTP or file manager.
Navigate to the
qb-coreresource directory and find theqb-core/shared/items.lua.
Open
shared.lua:Use a text editor to open the
shared.luafile within the[items]folder.
Add Your Item:
Find the section where items are defined. Add your new item details to the existing item table.
Save and Restart:
Save the
items.luafile and restart your server.
For ox_inventory
ox_inventoryIf you’re using ox_inventory, you need to modify the ox_inventory/data/items.lua file.
Steps to Modify:
Locate the
[items]Directory:Connect to your server files via FTP or file manager.
Navigate to the
ox_inventoryresource directory and find theox_inventory/data/items.lua.
Open
items - ox_inventory.lua:Use a text editor to open the
items - ox_inventory.luafile.
Add Your Item:
Find the section where items are defined and use the appropriate method to register your new item.
Save and Restart:
Save the
items.luafile and restart your server.
For esx inventory
esx inventoryIf you’re using esx inventory, you’ll need to update the items table in your database.
Steps to Modify:
Locate the
[items]Directory:Connect to your server’s database management tool (e.g., phpMyAdmin) and find the
items.sqlfile.
Open and Edit
items.sql:Open the
items.sqlfile and add your new item details to the appropriate table, usuallyitems.
Apply Changes:
Execute the SQL query to add the item to your database.
Restart Your Server:
Restart your server to ensure the new item is available.
For qs_inventory
qs_inventoryIf you’re using qs_inventory, you need to edit the shared.lua file located in the [items] folder.
Steps to Modify:
Locate the
[items]Directory:Connect to your server files via FTP or file manager.
Navigate to the
qs_inventoryresource directory and find theqs_inventory/shared/items.lua.
Open
shared.lua:Use a text editor to open the
shared.luafile within the[items]folder.
Add Your Item:
Find the section where items are defined and add your new item details.
Save and Restart:
Save the
items.luafile and restart your server.
Verifying Your Changes
Test the New Item:
Verify in-game that the new item appears and functions as expected.
Check Inventory System:
Ensure the item is properly integrated into your inventory system and is visible in the correct sections.
Troubleshooting
Item Not Showing Up: Check for syntax errors and confirm that the server has been restarted.
Errors in Console: Review server logs for any error messages related to item addition.
Additional Tips
Backup Files: Always backup the original files before making changes.
Consult Documentation: Refer to the documentation for your specific inventory system for additional guidance and best practices.
Last updated