---
description: Configure the script inventory dependency
---

# Inventory

Step 1: Navigate to `mm_carkeys/shared/init.lua`

Step 2: If you have renamed the core folder, then change the name. <mark style="color:purple;">Ex: I have renamed qb-inventory to mm\_inventory</mark>

```lua
if GetResourceState('ox_inventory') == 'started' then -- change your inventory script
    Shared.Inventory = 'ox' -- dont touch this
elseif GetResourceState('mm_inventory') == 'started' then -- change your inventory script
    Shared.Inventory = 'qb' -- dont touch this
elseif GetResourceState('ps-inventory') == 'started' then -- change your inventory script
    Shared.Inventory = 'qb' -- dont touch this
elseif GetResourceState('qb-inventory') == 'started' then -- change your inventory script
    Shared.Inventory = 'qb' -- dont touch this
elseif GetResourceState('qs-inventory') == 'started' then -- change your inventory script
    Shared.Inventory = 'qb' -- dont touch this
else
    Shared.Inventory = false
    warn('No Inventory found')
end
```

### QB Based Inventory Addons

{% tabs %}
{% tab title="Old Version" %}
In <mark style="color:purple;">qb-inventory/html/app.js</mark> add this in function `FormatItemInfo`

```javascript
} else if (itemData.name == "vehiclekey") {
    $(".item-info-title").html('<p>'+itemData.info.label+'</p>');
    $(".item-info-description").html('<p>Plate: '+itemData.description+'</p>');
} else if (itemData.name == "keybag") {
    let msg = "";
    for(let i = 0; i < itemData.info.plates.length; i++) {
        msg += '<p><strong>Vehicle '+(i+1)+': </strong><span>' + itemData.info.plates[i].plate + '</span></p>'
    }
    $(".item-info-title").html('<p>'+itemData.label+'</p>');
    $(".item-info-description").html(msg);
```
{% endtab %}

{% tab title="New Version" %}
In <mark style="color:purple;">qb-inventory/html/app.js</mark> add this in function `generateDescription` (test)

```lua
case "vehiclekey":
    return `<p><strong>Model: </strong><span>${itemData.info.label}</span></p>
    <p><strong>Plate: </strong><span>${iitemData.info.plate}</span></p>`
case "keybag":
    let msg = "";
    for(let i = 0; i < itemData.info.plates.length; i++) {
        msg += `<p><strong>Vehicle ${i+1}: </strong><span>${itemData.info.plates[i].plate}</span></p>`
    }
    return msg;
```
{% endtab %}
{% endtabs %}

