A highly configurable backpack system for FiveM using ox_inventory with visual backpack props, inventory management, and illenium-appearance integration.
Say goodbye to secondary inventories and hello to an expandable inventory!
This script removes the fear of powergaming by NOT creating a separate backpack inventory. Instead, it dynamically increases your main ox_inventory slots and/or weight capacity. All items remain in your primary inventory, just with expanded capacity when wearing a backpack.
Traditional backpack systems create separate inventories that:
- Can be exploited for powergaming (hiding items during searches)
- Create confusion about where items are stored
- Require additional UI elements and inventory management
- Can cause item duplication or loss bugs
yote_backpacks solves this by:
- ✅ Expanding your MAIN inventory when wearing a backpack
- ✅ Keeping all items in ONE inventory that's searchable by police/admins
- ✅ No hidden storage or secondary containers
- ✅ Simple, clean, and exploit-proof
- ✅ Seamless integration with existing ox_inventory features
- 0.0 ms Usage - Optimized performance with no resource drain
- Single Inventory System - No secondary inventories, just expanded main inventory
- Dual Mode System - Choose between inventory item backpacks with props OR clothing bags from illenium-appearance
- Multiple Backpack Types - Configure unlimited custom backpacks with unique models, weights, and slots
- Weight & Slot Increase - Configurable weight and inventory slot bonuses per backpack
- Smart Removal Prevention - Can't remove backpack if overweight or using extra slots
- Clothing Bag Blacklist - Block specific clothing bag drawable/texture combinations from providing bonuses
- Debug Helper Command - Built-in command to identify clothing bag drawable and texture IDs
- Disconnection Protection - Items in extra slots are saved and restored on reconnect
- Vehicle Integration - Optional backpack removal when entering vehicles
- Single Backpack Limit - Optional enforcement of one backpack per player
- Fully Configurable - All settings, positions, and strings in config.lua
- Framework Compatible - Works with Qbox and theoretically any framework using ox_inventory
- Download this script
- Add the backpack items to your inventory (see below)
- Add backpack images to
ox_inventory/web/images/(found inyote_backpacks/_inventory_images/) - Place script in your
resourcesdirectory - Ensure
yote_backpacksafterox_libbut beforeox_inventory - Configure
config.luato choose your backpack system mode
- ox_lib
- ox_inventory
- illenium-appearance (Optional - only if using clothing bags)
All settings can be found in config.lua:
Config.UseInventoryBags = true -- Use inventory item backpacks with visual props?
Config.UseClothingBags = false -- Use clothing bags from illenium-appearance?Note: You can enable one, both, or neither system
Config.OneBagInInventory = true -- Allow only one bag in inventory?
Config.RemoveBagInVehicle = true -- Remove backpack visual in vehicles?Config.EnableWeightIncrease = true -- Enable weight increase?
Config.EnableSlotIncrease = true -- Enable slot increase?Config.ClothingBagWeightIncrease = 10000 -- Weight increase when wearing clothing bag
Config.ClothingBagSlotIncrease = 10 -- Slot increase when wearing clothing bagBlock specific clothing bag combinations from providing inventory bonuses:
Config.ClothingBagBlacklist = {
[0] = true, -- Block drawable 0 (no bag) with all textures
[45] = {0, 1, 2}, -- Block drawable 45 with textures 0, 1, and 2 only
[82] = true, -- Block drawable 82 with all textures
-- Add more entries as needed
}Blacklist Format:
[drawable] = true- Blocks ALL textures for that drawable[drawable] = {texture1, texture2, ...}- Blocks specific textures for that drawable
How to Find IDs: Use the built-in debug command (see Debug Helper Command section below)
Config.EnableDebugCommand = true -- Enable the debug command?
Config.DebugCommandName = 'baginfo' -- Command name to useUsage: Type /baginfo (or your custom command) in-game to see:
- Current clothing bag drawable ID
- Current clothing bag texture ID
- Whether it's blacklisted
This makes it easy to identify which drawable/texture combinations to add to your blacklist.
Config.DefaultBackpackOffset = { x = 0.07, y = -0.11, z = -0.05 }
Config.DefaultBackpackRotation = { x = 0.0, y = 90.0, z = 175.0 }
Config.BackpackBone = 24818 -- Bone index for attachmentConfig.Backpacks = {
['backpack'] = {
label = 'Backpack',
model = `p_michael_backpack_s`,
weightIncrease = 10000, -- grams
slotIncrease = 10,
offset = nil, -- nil = use default
rotation = nil,
},
['duffel_bag'] = {
label = 'Duffel Bag',
model = `prop_cs_heist_bag_02`,
weightIncrease = 15000,
slotIncrease = 15,
offset = {x = 0.10, y = -0.15, z = -0.10},
rotation = {x = 0.0, y = 90.0, z = 175.0},
},
-- Add as many custom backpacks as you want!
}Config.SpawnDelay = 4500 -- Delay after player connects (ms)
Config.BackpackCheckDelay = 1000 -- Delay for duplicate check (ms)Add these to ox_inventory/data/items.lua:
['backpack'] = {
label = 'Backpack',
weight = 220,
stack = false,
consume = 0,
},
['duffel_bag'] = {
label = 'Duffel Bag',
weight = 350,
stack = false,
consume = 0,
},Unlike traditional backpack systems that create a separate container, yote_backpacks modifies your main inventory's capacity:
Without Backpack:
- Inventory: 50 slots, 30kg capacity
- All items visible in main inventory
With Backpack:
- Inventory: 60 slots (+10), 40kg capacity (+10kg)
- Still one inventory, just with more space
- Police can search and see ALL items
- No hidden compartments or secondary storage
- Equipping: When a player has a backpack in their inventory, it automatically appears on their back
- Visual Prop: Backpack model is spawned and attached to the player
- Weight Bonus: Player's max weight increases by the backpack's configured amount
- Slot Bonus: Player gains additional inventory slots based on backpack type
- Removal Protection: Can't remove backpack if:
- Current weight exceeds original max weight
- Items are in the extra slots provided by the backpack
- Vehicle Handling: Backpack visual can be automatically removed when entering vehicles
- Clothing Component: Uses the existing bag clothing component (component 5) from character creator
- Automatic Detection: Script detects when player equips/removes a clothing bag
- Blacklist System: Certain drawable/texture combinations can be blocked from providing bonuses
- Weight & Slot Bonus: Applies configured bonuses when wearing any non-blacklisted clothing bag
- Removal Protection: Can't remove clothing bag via appearance menu if:
- Current weight exceeds original max weight
- Items are in the extra slots provided by the bag
- Forced Restoration: If player somehow removes the bag while restricted, it's automatically put back on
The blacklist allows you to prevent specific clothing items from being treated as bags:
Use Cases:
- Block drawable 0 (no bag equipped)
- Exclude non-bag clothing items that happen to use component slot 5
- Prevent specific bag models from providing bonuses
- Block parachute bags or other special items
Finding IDs:
- Enable the debug command in config:
Config.EnableDebugCommand = true - Equip the clothing item you want to check
- Use the command in-game:
/baginfo(or your custom command name) - Note the Drawable and Texture IDs shown
- Add them to
Config.ClothingBagBlacklist
Example Output:
Current Bag - Drawable: 45, Texture: 2, Blacklisted: false
- When a player disconnects with items in extra slots, those items are saved to a JSON file
- Items are automatically restored when the player reconnects with the same backpack
- Prevents item loss from unexpected disconnections or server restarts
Config.UseInventoryBags = true
Config.UseClothingBags = falsePlayers use backpack items from inventory with visual props
Config.UseInventoryBags = false
Config.UseClothingBags = truePlayers use clothing bags from illenium-appearance character creator
Config.UseInventoryBags = true
Config.UseClothingBags = truePlayers can use both inventory backpacks AND clothing bags simultaneously
Config.UseInventoryBags = false
Config.UseClothingBags = falseScript is effectively disabled (useful for testing)
-
Single Inventory: All items remain in your main inventory
- Police searches show EVERYTHING
- Admin tools can see ALL items
- No "hidden" backpack inventory to abuse
-
Removal Prevention: Can't drop backpack to avoid searches
- System prevents removal if slots are in use
- Forced to keep backpack on if using extra capacity
- No quick-drop exploits
-
Visual Confirmation: Backpack is visible on player
- Officers can see if someone has expanded capacity
- Prop appears on player's back (inventory bags mode)
- Clothing bag visible in appearance (clothing mode)
-
Transparent System: Everything uses ox_inventory's native features
- No custom inventory containers
- No hidden storage compartments
- Works with all existing ox_inventory features
Simply add a new entry to Config.Backpacks:
['your_backpack'] = {
label = 'Your Custom Backpack',
model = `prop_model_hash`, -- Find models in CodeWalker
weightIncrease = 12000,
slotIncrease = 12,
offset = {x = 0.0, y = 0.0, z = 0.0}, -- Adjust for proper positioning
rotation = {x = 0.0, y = 0.0, z = 0.0},
},- Enable debug command:
Config.EnableDebugCommand = true - Equip the clothing item in-game
- Run command:
/baginfo - Add the drawable/texture to blacklist:
Config.ClothingBagBlacklist = {
[45] = {0, 1, 2}, -- Block specific textures
[82] = true, -- Block all textures
}Edit the Strings table in config.lua:
Strings = {
action_incomplete = 'Action Incomplete',
one_backpack_only = 'You can only have 1 backpack on!',
too_much_weight = 'You are carrying too much weight. Remove items first.',
items_in_extra_slots = 'You have items in extra slots. Move them first.',
cannot_remove_backpack = 'Cannot Remove Backpack',
}Each backpack can have custom offset and rotation, or use defaults:
offset- Position relative to player (x, y, z in meters)rotation- Rotation angles (x, y, z in degrees)- Set to
nilto useConfig.DefaultBackpackOffsetandConfig.DefaultBackpackRotation
Command: /checkbag (or your custom command name from config)
Purpose: Display information about your current clothing bag
Output:
- Drawable ID of current bag
- Texture ID of current bag
- Whether it's blacklisted
Usage:
- Equip a clothing bag in illenium-appearance
- Run the command
- Use the IDs shown to configure your blacklist
Console Output: Also prints to F8 console for easier copying
- Client: 0.00ms idle, 0.01ms when checking inventory changes
- Server: Minimal resource usage, event-driven architecture
- Resmon: Consistently shows 0.00ms in most scenarios
- Optimizations: Uses ox_lib caching, minimal loops, event-based updates
For support, bug reports, or feature requests:
- Join our Discord: [Your Discord Link]
- GitHub Issues: [Your GitHub Link]
- Documentation: This README
- Originally inspired by wasabi_backpack
- Heavily modified and enhanced by Yote
- Uses ox_lib and ox_inventory by Overextended
- Compatible with illenium-appearance by iLLenium Studios
This project is open source and available for modification and redistribution. Feel free to modify and use in your server, but please provide credit to the original creator.
Version: 1.1.0
Last Updated: December 10, 2025
Tested On: FiveM Build 6683, ox_inventory v2.x, illenium-appearance v1.x