> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_inventory/event-handlers/server.md).

# Server

### 📦 Item Events

Events triggered when items are manipulated in a player's inventory on the server side.

#### On Remove Item

Triggered on the server when a player successfully removes an item from their inventory.

```lua
AddEventHandler('ak47_inventory:onRemoveItem', function(source, item, amount, slot, has)
    -- Your code here
end)
```

**Parameters:**

* source: `number`
  * The server ID of the player
* item: `string`
  * The name of the item removed
* amount: `number`
  * The quantity of the item that was removed
* slot: `number`
  * The slot index the item was removed from
* has: `number`
  * The total amount of this item the player still has after removal

#### On Add Item

Triggered on the server when a player successfully receives an item into their inventory.

```lua
AddEventHandler('ak47_inventory:onAddItem', function(source, item, amount, slot, has)
    -- Your code here
end)
```

**Parameters:**

* source: `number`
  * The server ID of the player
* item: `string`
  * The name of the item added
* amount: `number`
  * The quantity of the item that was added
* slot: `number`
  * The slot index the item was added to
* has: `number`
  * The total amount of this item the player now has
