> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/house-robbery-with-welding-minigame/inventory-integration.md).

# Inventory Integration

### ✅ <mark style="color:blue;">ox\_inventory and qs-inventory already integrated with rm\_houserobbery.</mark>

## qb-inventory Integration

<mark style="color:orange;">This guide is for</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**qb-inventory**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">2.0.0. If you are using an older version of</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**qb-core**</mark><mark style="color:orange;">, the</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**AddItem**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">and</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**RemoveItem**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">functions might be located in</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**qb-core/server/player.lua**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">or in any of the files within</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**qb-inventory/server/**</mark><mark style="color:orange;">.</mark>

### Add Item Events to qb-inventory

To add item-related events to `qb-inventory`, follow these steps:

#### 1. Modifying the `AddItem` Function

In the file `qb-inventory/server/functions.lua`, locate the `AddItem` function. To trigger events when an item is added, insert the following code **before** the line `return true`

```lua
TriggerEvent('qb-inventory:server:itemAdded', identifier, item, amount, updated or amount)
TriggerClientEvent('qb-inventory:client:itemAdded', identifier, item, amount, updated or amount)
```

<div align="left"><figure><img src="/files/2j0eYEsjPewAALEzK410" alt="" width="563"><figcaption></figcaption></figure></div>

#### 2. Modifying the `RemoveItem` Function

Similarly, locate the `RemoveItem` function in `qb-inventory/server/functions.lua`. Add the following lines of code **before** the `return true` statement to trigger events when an item is removed:

```lua
TriggerEvent('qb-inventory:server:itemRemoved', identifier, item, amount, inventoryItem.amount)
TriggerClientEvent('qb-inventory:client:itemRemoved', identifier, item, amount, inventoryItem.amount)
```

<div align="left"><figure><img src="/files/e9vk4IqcZ3FrOWv3m0WJ" alt="" width="563"><figcaption></figcaption></figure></div>

## Custom Inventory

#### Steps to Integrate Your Custom Inventory Script

1. **Assign Events to Functions:** In your custom inventory script, place the events for the `AddItem` and `RemoveItem` functions at the appropriate locations as specified.
2. **Copy and Rename the File:**
   * Navigate to the `rm_houserobbery/bridge/inventory` folder.
   * Copy one of the existing inventory script files. (like qb-inventory)
   * Rename the copied file to match the name of your custom inventory script.
3. **Update Event Names:** Open the newly created file and replace the event names with the ones you assigned in Step 1.

That’s all! You now have your custom inventory script integrate.
