Installation
Install Bags
1. Ensure you have the dependencies: ox_lib ox_inventory ox_target (optional to “Open Bag” on ground)
2. Unzip the contents and place the folder in your server resource folder
3. The inventory and images need to be added to ox_inventory. Locate the items folder in the bs_bags resource copy the images and paste them to ox_inventory Located at ox_inventory/web/images/
4. Copy the items in the file ITEMS_FOR_OX_INVENTORY to ox_inventory items file is located in ox_inventory/data/items.lua
["box"] = {
label = "Box",
weight = 1000,
stack = false,
close = false,
consume = 0,
description = "A cardboard box. Adds 3 slots and 5 kg carrying capacity.",
client = { export = "bs_bags.openBag" },
},
["small_backpack"] = {
label = "Small Backpack",
weight = 500,
stack = false,
close = false,
consume = 0,
description = "A small backpack. Adds 5 slots and 5 kg.",
client = { export = "bs_bags.openBag" },
},
["backpack"] = {
label = "Backpack",
weight = 1000,
stack = false,
close = false,
consume = 0,
description = "A standard backpack. Adds 15 slots and 15 kg.",
client = { export = "bs_bags.openBag" },
},
["tactical_backpack"] = {
label = "Tactical Backpack",
weight = 2000,
stack = false,
close = false,
consume = 0,
description = "A large tactical backpack. Adds 25 slots and 25 kg.",
client = { export = "bs_bags.openBag" },
},
["small_dufflebag"] = {
label = "Small Duffle Bag",
weight = 400,
stack = false,
close = false,
consume = 0,
description = "A small duffle bag. Adds 10 slots and 8 kg.",
client = { export = "bs_bags.openBag" },
},
["dufflebag"] = {
label = "Duffle Bag",
weight = 800,
stack = false,
close = false,
consume = 0,
description = "A duffle bag worn over the shoulder. Adds 20 slots and 20 kg.",
client = { export = "bs_bags.openBag" },
},
["large_dufflebag"] = {
label = "Large Duffle Bag",
weight = 1500,
stack = false,
close = false,
description = "A large duffle bag. Adds 30 slots and 35 kg.",
client = { export = "bs_bags.openBag" },
},
["airport_bag"] = {
label = "Airport Bag",
weight = 600,
stack = false,
close = false,
consume = 0,
description = "A compact travel bag. Adds 15 slots and 12 kg.",
client = { export = "bs_bags.openBag" },
},
["beach_bag"] = {
label = "Beach Bag",
weight = 300,
stack = false,
close = false,
consume = 0,
description = "A lightweight beach bag. Adds 8 slots and 5 kg.",
client = { export = "bs_bags.openBag" },
},
["briefcase"] = {
label = "Briefcase",
weight = 500,
stack = false,
close = false,
consume = 0,
description = "A professional briefcase. Adds 10 slots and 8 kg.",
client = { export = "bs_bags.openBag" },
},
["guncase"] = {
label = "Gun Case",
weight = 2000,
stack = false,
close = false,
consume = 0,
description = "A hard gun case. Adds 15 slots and 12 kg.",
client = { export = "bs_bags.openBag" },
},
["handbag"] = {
label = "Handbag",
weight = 200,
stack = false,
close = false,
consume = 0,
description = "A handbag. Adds 5 slots and 3 kg.",
client = { export = "bs_bags.openBag" },
},
["medical_bag"] = {
label = "Medical Bag",
weight = 1500,
stack = false,
close = false,
consume = 0,
description = "A medical bag. Adds 12 slots and 8 kg.",
client = { export = "bs_bags.openBag" },
},
["medical_case"] = {
label = "Medical Case",
weight = 1000,
stack = false,
close = false,
consume = 0,
description = "A first aid/medical case. Adds 10 slots and 6 kg.",
client = { export = "bs_bags.openBag" },
},
["shopping_bag"] = {
label = "Shopping Bag",
weight = 100,
stack = false,
close = false,
consume = 0,
description = "A reusable shopping bag. Adds 3 slots and 2 kg.",
client = { export = "bs_bags.openBag" },
},
["suitcase"] = {
label = "Suitcase",
weight = 2500,
stack = false,
close = false,
consume = 0,
description = "A travel suitcase. Adds 20 slots and 15 kg.",
client = { export = "bs_bags.openBag" },
},
["toolbox"] = {
label = "Toolbox",
weight = 3000,
stack = false,
close = false,
consume = 0,
description = "A metal toolbox. Adds 15 slots and 15 kg.",
client = { export = "bs_bags.openBag" },
},
-
Now, we need to edit the drop prop model to show the bag when dropped. Open
ox_inventory/modules/inventory/server.luawhere drops are created:Search for this line:
TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId], playerInventory.open and source, slot)Above it, we need to remove:
Inventory.Drops[dropId] = {coords = inventory.coords, instance = data.instance}And replace it with the code below:
local dropModel = nil
if GetResourceState('bs_bags') == 'started' then
local ok, model = pcall(function() return exports.bs_bags:GetDropModel(toData.name) end)
if ok and model and type(model) == 'string' then dropModel = model end
end
Inventory.Drops[dropId] = {coords = inventory.coords, instance = data.instance, model = dropModel}
If done right it should look like:
inventory.coords = data.coords`
local dropModel = nil`
if GetResourceState('bs_bags') == 'started' then`
local ok, model = pcall(function() return exports.bs_bags:GetDropModel(toData.name) end)`
if ok and model and type(model) == 'string' then dropModel = model end`
end`
Inventory.Drops[dropId] = {coords = inventory.coords, instance = data.instance, model = dropModel}`
playerInventory.changed = true`
TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId], playerInventory.open and source, slot)
- You can ensure the resource at the end, but it has to be after all [ox] and framework resources.
- Optional - We have added an ox_inventory shops option to quickly add these to your in game stores. Copy this code to any shop in ox_inventory/data/shops.lua
{ name = 'airport_bag', price = 150 },
{ name = 'backpack', price = 200 },
{ name = 'beach_bag', price = 75 },
{ name = 'box', price = 25 },
{ name = 'briefcase', price = 120 },
{ name = 'dufflebag', price = 250 },
{ name = 'guncase', price = 350 },
{ name = 'handbag', price = 80 },
{ name = 'large_dufflebag', price = 400 },
{ name = 'medical_bag', price = 300 },
{ name = 'medical_case', price = 200 },
{ name = 'shopping_bag', price = 15 },
{ name = 'small_backpack', price = 100 },
{ name = 'small_dufflebag', price = 150 },
{ name = 'suitcase', price = 280 },
{ name = 'tactical_backpack', price = 450 },
{ name = 'toolbox', price = 220 },
- Make sure to select your framework in the config.lua file.