> For the complete documentation index, see [llms.txt](https://brunx-mods.gitbook.io/brunx-mods-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brunx-mods.gitbook.io/brunx-mods-docs/products/scripts/ice-o-rink-system/inventories/server-guide.md).

# Server guide

Make sure to check the qb-inventory.lua and ox\_inventory.lua files for examples on how to implement the script for your framework. They are always up to date with the latest changes.

Make sure to check the qb-inventory.lua and ox\_inventory.lua files for examples on how to implement the script for your framework. They are always up to date with the latest changes.

## Inventory functions

### addItem

***

Function to add item to inventory

<pre class="language-lua"><code class="lang-lua">-- This is an example from the brnx-iceorinksystem qb.lua file

<strong>-- @param source: number | string
</strong><strong>-- @param item: string
</strong><strong>-- @param amount: number
</strong>addItem = function(source, item, amount)
    exports['qb-inventory']:AddItem(source, item, amount)
end
</code></pre>

### removeItem

***

Remove item function

<pre class="language-lua"><code class="lang-lua">-- This is an example from the brnx-iceorinksystem qb.lua file

<strong>-- @param source: number | string
</strong><strong>-- @param item: string
</strong><strong>-- @param amount: number
</strong>removeItem = function(source, item, amount)
    return exports['qb-inventory']:RemoveItem(source, item, amount)
end
</code></pre>

### getItemAmount

***

function to get the quantity of the item in the inventory

<pre class="language-lua"><code class="lang-lua">-- This is an example from the brnx-iceorinksystem qb.lua file

<strong>-- @param source: number | string
</strong><strong>-- @param item: string
</strong>getItemAmount = function(source, item)
    local Player = QB.Functions.GetPlayer(source)
    local invItem = Player.Functions.GetItemByName(item)
    return invItem?.amount or 0
end
</code></pre>

### openWardrobe

***

function to open wadrobe

<pre class="language-lua"><code class="lang-lua">-- This is an example from the brnx-iceorinksystem qb.lua file

<strong>-- @param source: number | string
</strong>openWardrobe = function(source)
    exports['qb-inventory']:OpenInventory(source, 'iceorink', {
        label = 'Ice O Rink',
        maxweight = 15000,
        slots = 5
    })
end
</code></pre>
