A custom inventory system for ESX Legacy with a modern UI similar to ox_inventory, featuring ox_lib integration for notifications and progress bars.
- β¨ Modern, responsive UI with drag & drop support
- π― Weight-based inventory system
- π₯ Hotbar system (5 slots)
- π¦ Item stacking and splitting
- π Context menu for quick actions
- πΌ Vehicle trunk and glovebox support
- πͺ Shop system with multiple locations
- π§ Crafting system with workbenches
- π₯ Give items to nearby players
- π Drop system with ground objects
- π ox_lib notifications
- β³ ox_lib progress bars with animations
- π Item search functionality
- π Item rarity system
- π Real-time weight display
- π Organized item, shop, and crafting definitions
- es_extended - ESX Framework
- ox_lib - Overextended Library
- oxmysql - MySQL Wrapper
- Download and extract the
main-inventoryfolder to your resources directory - Ensure all dependencies are installed and started
- Add
ensure main-inventoryto your server.cfg - Add your item images to
html/items/folder (PNG format, named after item name) - Restart your server
All configurations are now organized in separate files:
- Maximum inventory weight and slots
- Hotbar settings
- Drop lifetime and distance
- Vehicle inventory sizes
- Progress bar timings
- Animations
- Item definitions with metadata
- Item weights, stackability, and descriptions
- Item usage animations and effects
- Illegal and rare item classifications
- Shop locations and items
- Shop blip configurations
- Job-restricted shops (police, ambulance, mechanic)
- Item prices per shop
- License requirements
- Crafting recipes and requirements
- Crafting bench locations
- Job-restricted recipes
- Material requirements
- Crafting times
- Default key:
F2(configurable inconfig.lua) - Command:
/openInventory
- Use items in hotbar slots with keys
1-5 - Drag items from inventory to hotbar slots
- Right-click on items to:
- Use item
- Give to nearby player
- Drop item
- Split stack
/openInventory- Open player inventory/openstorage- Open storage (when near configured storage)/craft- Open crafting menu (when near crafting bench)/shoptest- Open 24/7 shop (testing command)
-- Open player inventory
exports['main-inventory']:OpenInventory()
-- Close inventory
exports['main-inventory']:CloseInventory()
-- Open target player inventory (for police search, etc.)
exports['main-inventory']:OpenTargetInventory(targetServerId)
-- Open shop
exports['main-inventory']:OpenShop(shopName)
-- Open vehicle inventory
exports['main-inventory']:OpenVehicleInventory(vehicle, 'trunk') -- or 'glovebox'-- Add item to player
TriggerEvent('main-inventory:addItem', source, itemName, count)
-- Remove item from player
TriggerEvent('main-inventory:removeItem', source, itemName, count)
-- Give item to another player
TriggerEvent('main-inventory:giveItem', source, targetId, itemName, count)Place your item images in html/items/ with the following format:
- Filename:
itemname.png(must match the item name in ESX) - Format: PNG with transparent background
- Recommended size: 256x256 pixels
- A
default.pngimage will be used if item image is not found
[Add your screenshots here]
Edit shared/items.lua:
['your_item'] = {
label = 'Your Item Name',
weight = 500, -- in grams
stack = true, -- stackable?
close = true, -- close inventory on use?
description = 'Item description',
rare = false, -- rare item?
illegal = false, -- illegal item?
client = {
status = {hunger = 200000}, -- optional status effects
anim = {dict = 'anim_dict', clip = 'anim_clip'}, -- usage animation
usetime = 2500, -- time to use in ms
}
}Edit shared/shops.lua:
['your_shop'] = {
name = 'Your Shop Name',
blip = {
sprite = 52,
color = 2,
scale = 0.8,
display = 4,
},
items = {
{name = 'bread', price = 5},
{name = 'water', price = 3},
},
locations = {
vector3(x, y, z),
},
jobs = {}, -- Optional: {'police', 'ambulance'}
license = 'weapon', -- Optional: required license
}Edit shared/crafting.lua:
-- Add recipe
['your_item'] = {
label = 'Your Item',
items = {
{name = 'material1', amount = 2},
{name = 'material2', amount = 1},
},
time = 5000, -- craft time in ms
amount = 1, -- items crafted
jobs = {}, -- Optional: job restrictions
illegal = false, -- illegal recipe?
}
-- Add crafting bench
['your_bench'] = {
label = 'Your Bench',
recipes = {
'your_item',
'another_item',
},
locations = {
vector3(x, y, z),
},
jobs = {}, -- Optional: job restrictions
}Edit config.lua:
Config.Stashes['storage_name'] = {
label = 'Storage Label',
slots = 50,
weight = 100000,
jobs = {'police'} -- Optional: restrict to specific jobs
}For issues, suggestions, or support:
- GitHub Issues: Create an issue
This project is licensed under the MIT License.
- Developed by Main-Scripts
- Inspired by ox_inventory
- Uses ox_lib for UI components
- Built for ESX Legacy
- Initial release
- Basic inventory system
- Hotbar implementation
- Drop system
- Vehicle inventory
- Shop system with multiple locations
- Crafting system with workbenches
- Organized item/shop/crafting definitions
- ox_lib integration
- 50+ predefined items
- Multiple shop types (24/7, liquor, hardware, weapons, job-specific)
- Crafting benches (workbench, weapon bench, mechanic, kitchen, drug lab)