Item Setup

Items Setup Guide

Detailed guide for adding nail trap items to your inventory system.

Overview

The GOD - Nail Trap System requires two items to be added to your inventory:

  1. screw_nail - Single-use nail item

  2. nailspackage - Package containing multiple nails (up to 20)

ox_inventory Setup

Step 1: Locate Items File

Navigate to your ox_inventory directory and open:

ox_inventory/data/items.lua

Step 2: Add Items

Add the following items to your items.lua file:

['screw_nail'] = {
    label = 'Nail',
    weight = 5000,
    stack = true,
    close = true,
    description = 'A specially crafted nail to do something haha..',
    client = {
        image = 'screw_nail.png',
        export = 'J0-nailScript.useNail'
    },
},

['nailspackage'] = {
    label = 'Nails Package',
    weight = 5000,
    stack = true,
    close = true,
    description = 'A specially crafted nail to do something haha..',
    client = {
        image = 'nailspackage.png',
        export = 'J0-nailScript.useNailPackage'
    },
},

Step 3: Add Item Images

  1. Copy screw_nail.png from J0-nailScript/installme/ directory

  2. Place it in: ox_inventory/web/images/screw_nail.png

  3. For nailspackage, you can use the same image or create a custom one:

    • Place in: ox_inventory/web/images/nailspackage.png

Step 4: Restart Resource

After adding items, restart your ox_inventory resource:

ox_inventory Item Properties Explained

Property
Value
Description

label

'Nail' / 'Nails Package'

Display name in inventory

weight

5000

Item weight (adjust as needed)

stack

true

Items can stack in inventory

close

true

Closes inventory when used

description

Custom text

Item description tooltip

client.export

Function name

Client-side export to call

qb-inventory Setup

Step 1: Locate Items File

Navigate to your qb-inventory directory and open:

Step 2: Add Items

Add the following items to your items.lua file:

Step 3: Add Item Images

  1. Copy screw_nail.png from J0-nailScript/installme/ directory

  2. Place it in: qb-inventory/html/images/screw_nail.png

  3. For nailspackage, you can use the same image or create a custom one:

    • Place in: qb-inventory/html/images/nailspackage.png

Step 4: Restart Resource

After adding items, restart your qb-inventory resource:

qb-inventory Item Properties Explained

Property
Value
Description

name

Item identifier

Must match the key

label

Display name

Name shown in inventory

weight

5000

Item weight (adjust as needed)

type

"item"

Item type classification

image

PNG filename

Image file name (without path)

unique

false

Item is not unique (can have multiple)

useable

true

Item can be used/consumed

shouldClose

true

Closes inventory when used

combinable

nil

No combination recipes

description

Custom text

Item description tooltip

ESX Inventory Setup

If you're using ESX with a custom inventory system, follow the instructions for your specific inventory.

For standard ESX, you may need to:

  1. Add items to your database (if using database items)

  2. Register useable items in your ESX configuration (see Installation Guide)

Item Customization

Changing Item Weight

Adjust the weight property to match your server's economy:

Changing Item Description

Customize the description to match your server's lore:

Changing Item Labels

Customize display names:

Custom Item Images

  1. Create custom images (recommended size: 512x512px)

  2. Save as PNG format

  3. Place in appropriate inventory images directory

  4. Update image property in item configuration

Verification

After adding items:

  1. Restart Inventory Resource

  2. Check Items in Game

    • Open inventory

    • Verify items appear with correct names

    • Check images display correctly

    • Verify item descriptions show

  3. Test Item Usage

    • Use screw_nail - should place a nail

    • Use nailspackage - should allow placing multiple nails

    • Verify items are consumed when used

  4. Check Console

    • No errors when using items

    • No missing export errors

    • No image loading errors

Common Issues

Items Don't Appear

Solution:

  • Verify item names match exactly (case-sensitive)

  • Check file syntax (commas, brackets)

  • Restart inventory resource

  • Clear server cache if needed

Images Don't Load

Solution:

  • Verify image files are in correct directory

  • Check file names match exactly (case-sensitive)

  • Ensure images are PNG format

  • Clear browser cache (for web-based inventories)

Items Don't Work When Used

Solution:

  • Verify J0-nailScript resource is running

  • Check shared/config.lua for correct inventory system

  • Verify exports are available (ox_inventory)

  • Check server console for errors

ox_inventory Export Not Found

Solution:

  • Verify export property is correct: 'J0-nailScript.useNail'

  • Check J0-nailScript resource is started

  • Verify client exports are registered

  • Check for typos in export names

Item Distribution

Giving Items to Players

ox_inventory:

qb-inventory:

Adding to Shops

Add items to your shop configuration files to allow players to purchase nails.

Adding to Crafting

You can create crafting recipes to allow players to craft nails from materials.

Best Practices

  1. Consistent Naming: Keep item names consistent across all configurations

  2. Proper Images: Use high-quality images for better user experience

  3. Balanced Weight: Set appropriate weight values for game balance

  4. Clear Descriptions: Write descriptive item descriptions for players

  5. Test Thoroughly: Always test items after adding them


Items setup complete! Your inventory is ready for the Nail Trap System. 📦

Last updated