# Installation

First we want you to know that our script only supports the following versions of the two most used frameworks, in older versions it may be usable but we do not provide support since the development focuses on the following versions:

{% hint style="danger" %}
**VERY IMPORTANT for any framework**

For a safe startup, please do not put your framework and inventory folders in shared folders *(they are in brackets)*

*If you do:*&#x20;

`ensure qb-core`

`ensure origen_inventory`

And, we assume that origin\_inventory is inside `[origen]` and then do:&#x20;

`ensure [origen]`

This will cause origin\_inventory to restart again and **make it error** out, same for core.

<mark style="color:red;background-color:red;">**REMOVE THESE RESOURCES FROM BRACKETS FOLDERS AND SET ON ROOT RESOURCES FOLDER.**</mark>
{% endhint %}

{% tabs %}
{% tab title="QBCore 1.3.0" %}
{% hint style="info" %}
**IMPORTANT**

Installation of QB-Core is automatic and **requires NO code modifications**.
{% endhint %}

{% code title="server.cfg" overflow="wrap" %}

```
ensure oxmysql
ensure qb-core
ensure origen_inventory
...(make sure starts other scripts that use inventory functions after the origen_inventory)
```

{% endcode %}

#### Now you have to insert the SQL files into your database:

* [origen\_inventory/origen\_inventory.sql](https://docs.origennetwork.store/origen_inventory/installation/sql)

### Qb-Inventory Compatibility

Go to origen\_inventory/fxmanifest.lua and uncomment:

```lua
-- Before:
-- provide 'qb-inventory'

-- After:
provide 'qb-inventory'
```

{% endtab %}

{% tab title="ESX 1.12.4" %}
Since this and the latest versions of the inventory, installing Origen Inventory has been easier than ever.

We only need to place two files without making any modifications to the framework.

### 1. ESX Config

1. Go to es\_extended/shared/config/main.lua
2. Find ***Config.CustomInventory***
3. Replace by

   ```lua
   Config.CustomInventory = 'origen_inventory'
   ```
4. Comment or remove on `es_extended/shared/config/main.lua`&#x20;

   ```lua
   -- DO NOT CHANGE BELOW THIS LINE !!! <--- ignore this <3
   -------------------------------------
   if GetResourceState("ox_inventory") ~= "missing" then
       Config.CustomInventory = "ox"
   end
   ```
5. Done!

### 2. Install files

1. Go to es\_extended/server/bridge/inventory
2. Copy the file below

{% file src="<https://3936778620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPLI7NdIesJTaEUHH6a2U%2Fuploads%2FJmPcSjDO25OXLFEanKTv%2Forigeninventory.lua?alt=media&token=99f0b674-9926-4679-bf2a-0d4a642158a7>" %}

1. Go to es\_extended/server/classes/overrides
2. Copy the file below

{% file src="<https://3936778620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPLI7NdIesJTaEUHH6a2U%2Fuploads%2F4ie4l1rppSR1iiRwaETF%2Forigeninventory.lua?alt=media&token=1ca673a5-7b91-4e27-997e-ea8f0bbfde0e>" %}

### 3. Start the script in your server.cfg

Now you need to put the start in your server.cfg file. Like this form:

{% code title="server.cfg" overflow="wrap" %}

```
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure origen_inventory
...(make sure starts other scripts that use inventory functions after the origen_inventory)
```

{% endcode %}

Enjoy :smile:
{% endtab %}

{% tab title="QBX" %}
**Just for inventory version 2.0**

1. Go to qbx\_core/server/main.lua y remove lines 5-8:

```lua
elseif not lib.checkDependency('ox_inventory', '2.42.1', true) then
   startupErrors, errorMessage = true, 'ox_inventory version 2.42.1 or higher is required'
elseif GetConvar('inventory:framework', '') ~= 'qbx' then
   startupErrors, errorMessage = true, 'inventory:framework must be set to "qbx" in order to use qbx_core'
```

2. Go to origen\_inventory/fxmanifest.lua and uncomment:

```lua
   -- Uncomment if you have qbx_core installed
   provide 'ox_inventory'
```

3. Go to qbx\_core/bridge/qb/shared/main.lua comment lines 3-65:

```lua
   -- qbShared.Items = {}
   -- local oxItems = require '@ox_inventory.data.items'
   -- for item, data in pairs(oxItems) do
   --     qbShared.Items[item] = {
   --         name = item,
   --         label = data.label,
   --         weight = data.weight or 0,
   --         type = 'item',
   --         image = data.client?.image or string.strjoin(item,'.png'),
   --         unique = false,
   --         useable = true,
   --         shouldClose = data.close or true,
   --         combinable = nil,
   --         description = data.description or nil
   --     }
   -- end
   -- local oxWeapons = require '@ox_inventory.data.weapons'
   -- for weapon, data in pairs(oxWeapons.Weapons) do
   --     weapon = string.lower(weapon)
   --     qbShared.Items[weapon] = {
   --         name = weapon,
   --         label = data.label,
   --         weight = data.weight,
   --         type = 'weapon',
   --         ammotype = data.ammoname or nil,
   --         image = data.client?.image or string.strjoin(weapon,'.png'),
   --         unique = true,
   --         useable = false,
   --         shouldClose = true,
   --         combinable = nil,
   --         description = nil
   --     }
   -- end
   -- for component, data in pairs(oxWeapons.Components) do
   --     component = string.lower(component)
   --     qbShared.Items[component] = {
   --         name = component,
   --         label = data.label,
   --         weight = data.weight,
   --         type = 'component',
   --         image = data.client?.image or string.strjoin(component,'.png'),
   --         unique = true,
   --         useable = false,
   --         shouldClose = true,
   --         combinable = nil,
   --         description = data.description
   --     }
   -- end
   -- for ammo, data in pairs(oxWeapons.Ammo) do
   --     ammo = string.lower(ammo)
   --     qbShared.Items[ammo] = {
   --         name = ammo,
   --         label = data.label,
   --         weight = data.weight,
   --         type = 'ammo',
   --         image = data.client?.image or string.strjoin(ammo,'.png'),
   --         unique = true,
   --         useable = false,
   --         shouldClose = true,
   --         combinable = nil,
   --         description = data.description
   --     }
   -- end
```

4. Go to qbx\_core/bridge/qb/server/main.lua and comment lines 6-7:

```lua
   -- local convertItems = require 'bridge.qb.shared.compat'.convertItems
   -- convertItems(require '@ox_inventory.data.items', require 'shared.items')
```

5. Go to qbx\_core/server/player.lua and comment lines 1251-1253:

```lua
    -- if accountsAsItems[oxMoneyType] then
    --     exports.ox_inventory:SetItem(source, oxMoneyType, playerMoney[moneyType])
    -- end
```

6. Start your script in your server.cfg. Following this form:

{% code title="server.cfg" overflow="wrap" %}

```
ensure oxmysql
ensure ox_lib
ensure qbx-core
ensure origen_inventory
...(make sure starts other scripts that use inventory functions after the origen_inventory)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
We recommend uploading our script files without using FileZilla, as the upload process may corrupt our scripts. As a recommendation, please use WinSCP or other reliable programs to upload the files.
{% endhint %}
