Item Setup Guide
This guide will help you add the required items to your inventory system. Choose the section that matches your inventory system.
OX-Inventory Setup
Step 1: Add Items to items.lua
Navigate to:
ox_inventory/data/items.luaAdd the following items to your items table:
['laser_remover'] = {
label = 'Laser Remover',
weight = 1000,
client = { image = 'laser_remover.png' },
},
['laser_device'] = {
label = 'Self Security Laser',
weight = 1000,
client = { image = 'laser_device.png' },
},
['laser_devicepol'] = {
label = 'Police Security Laser',
weight = 1000,
client = { image = 'laser_device.png' },
},Step 2: Add Item Images
Navigate to:
ox_inventory/web/images/Add the following image files:
laser_remover.pnglaser_device.pnglaser_devicepol.png(can use the same image aslaser_device.png)
Note: Image dimensions should be 512x512 pixels for best quality.
Step 3: Add Item Usage Handlers
Navigate to:
ox_inventory/modules/items/client.luaAdd the following code at the end of the file:
Step 4: Restart Resource
After adding the items, restart your ox_inventory resource:
QB-Inventory Setup
Step 1: Add Items to items.lua
Navigate to:
qb-inventory/shared/items.luaAdd the following items to your items table:
Step 2: Add Item Images
Navigate to:
qb-inventory/html/images/Add the following image files:
laser_remover.pnglaser_device.pnglaser_devicepol.png(can use the same image aslaser_device.png)
Note: Image dimensions should be 512x512 pixels for best quality.
Step 3: No Additional Code Required
QB-Inventory automatically handles item usage through the CreateUseableItem function in the laser system's server script. No additional client-side code is needed.
Step 4: Restart Resource
After adding the items, restart your qb-inventory resource:
Item Descriptions
laser_device
Label: Self Security Laser (or Laser Device)
Description: A laser device that allows players to place security laser tripwires. When triggered, it notifies the owner.
Usage: Use the item to enter laser placement mode.
laser_devicepol
Label: Police Security Laser
Description: A police-only laser device. When triggered, it notifies all on-duty police officers in addition to the owner.
Usage: Use the item to enter laser placement mode (police version).
laser_remover
Label: Laser Remover
Description: A device that removes the closest laser to your position.
Usage: Use the item to remove the nearest laser.
Customizing Item Properties
You can customize the following properties for each item:
label: Display name shown in inventory
weight: Item weight (affects inventory capacity)
description: Item description shown in tooltips
image: Image file name (must match the file in images folder)
Example Customization
Troubleshooting
Items Not Showing in Inventory
Verify the item names match exactly (case-sensitive)
Check that images are in the correct folder
Ensure the resource has been restarted
Check server console for any errors
Items Not Working When Used
For OX-Inventory: Verify the item handlers are added to
client.luaFor QB-Inventory: Check that the server script is properly loaded
Verify the framework and inventory settings in
shared/config.luaCheck server console for error messages
Images Not Displaying
Verify image files are in the correct directory
Check file names match exactly (including extension)
Ensure images are in PNG format
Verify image dimensions are appropriate (512x512 recommended)
Items setup complete! Players can now purchase and use laser devices.
Last updated