> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set item metadata in slot

> Updates the metadata of an item in a specific inventory slot.

Updates the metadata of an item in a specific inventory slot.

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:setItemMetadataInSlot(inventoryId, slotId, metadata)
  ```

  ```lua Example theme={null}
  -- Update weapon ammo
  exports['jaksam_inventory']:setItemMetadataInSlot(1, 5, {
      serial = "ABC123",
      ammo = 6 -- update ammo count
  })

  -- Update item durability
  exports['jaksam_inventory']:setItemMetadataInSlot(1, 3, {
      durability = 50
  })
  ```
</CodeGroup>

### Parameters

| Name          | Data Type        | Description                            |
| ------------- | ---------------- | -------------------------------------- |
| `inventoryId` | string \| number | The inventory ID containing the item   |
| `slotId`      | number           | The slot containing the item to update |
| `metadata`    | table            | The new metadata to set                |

### Return value

| Name         | Data Type | Description                               |
| ------------ | --------- | ----------------------------------------- |
| `success`    | boolean   | True if metadata was updated successfully |
| `resultCode` | string    | Error message if the operation failed     |


## Related topics

- [Server](/jaksam-inventory/functions/server/index.md)
- [Metadata](/jaksam-inventory/guides/metadata.md)
- [Modules](/drugs-creator/modules.md)
- [Get item from slot](/jaksam-inventory/functions/client/get-item-from-slot.md)
