> For the complete documentation index, see [llms.txt](https://beetle-studios.gitbook.io/beetle-studios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beetle-studios.gitbook.io/beetle-studios-docs/beetle-studios/bags/installation.md).

# Installation

\
\
1\. Ensure you have the dependencies:\
&#x20;     [ox\_lib](https://github.com/overextended/ox_lib) \
&#x20;     [ox\_inventory](https://github.com/overextended/ox_inventory) \
&#x20;     [ox\_target](https://github.com/overextended/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.\
&#x20;    Locate the items folder in the bs\_bags resource \
&#x20;    copy the images and paste them to ox\_inventory\
&#x20;    *Located at ox\_inventory/web/images/*\
&#x20;     \
4\.  Copy the items in the file ITEMS\_FOR\_OX\_INVENTORY to ox\_inventory\
&#x20;     items file is located in *ox\_inventory/data/items.lua*

&#x20;     &#x20;

```
   ["box"] = {
        label       = "Box",
        weight      = 1000,
        stack       = false,
        close       = false,
        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,
        description = "A small backpack. Adds 5 slots and 5 kg.",
        client      = { export = "bs_bags.openBag" },
    },
    ["backpack"] = {
        label       = "Backpack",
        weight      = 1000,
        stack       = false,
        close       = false,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        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,
        description = "A travel suitcase. Adds 20 slots and 15 kg.",
        client      = { export = "bs_bags.openBag" },
    },
    ["toolbox"] = {
        label       = "Toolbox",
        weight      = 3000,
        stack       = false,
        close       = false,
        description = "A metal toolbox. Adds 15 slots and 15 kg.",
        client      = { export = "bs_bags.openBag" },
    },
```

5. Now, we need to edit the drop prop model to show the bag when dropped.\
   Open `ox_inventory/modules/inventory/server.lua` where 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:\
   &#x20;`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)`<br>

6. You can ensure the resource at the end, but it has to be after all \[ox] and framework resources.
7. *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 },
```

8. Make sure to select your framework in the config.lua file.
