# Add Item

By default, our scripts are ready to use with qb and esx inventories.

If you want to modify the functions to another inventory, for example OX\_Inventory or QS-Inventory here we show you how to do it. \
<mark style="color:orange;">**If it is another inventory you will have to check the documentation provided by its developer and adapt it.**</mark>

### QB + QB-Inventory

```lua
function addItem(playerID, item, amount)
    local player = QBCore.Functions.GetPlayer(playerID)
    if player then
        player.Functions.AddItem(item, amount)
        TriggerClientEvent('inventory:client:ItemBox', playerID, QBCore.Shared.Items[item], "add")
    end
end
```

### QB + OX\_Inventory

```lua
function addItem(playerID, item, amount)
    exports.ox_inventory:AddItem(playerID, item, amount)
end
```

### QB + QS-Inventory

```lua
function addItem(playerID, item, amount)
    exports['qs-inventory']:AddItem(playerID, item, amount)
end
```

### ESX

```lua
function addItem(playerID, item, amount)
    local xPlayer = ESX.GetPlayerFromId(playerID)
    if xPlayer then
        xPlayer.addInventoryItem(item, amount)
    end
end
```
