> ## 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.

# Save dirty inventories

> Saves all modified inventories to the database.

Saves all modified inventories to the database.

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:saveDirtyInventories()
  ```

  ```lua Example theme={null}
  -- Save all modified inventories
  exports['jaksam_inventory']:saveDirtyInventories()

  -- Good practice to save before server restart
  AddEventHandler('onResourceStop', function(resourceName)
      if resourceName == GetCurrentResourceName() then
          exports['jaksam_inventory']:saveDirtyInventories()
      end
  end)
  ```
</CodeGroup>

### Parameters

None.

### Return value

| Name      | Data Type | Description                                     |
| --------- | --------- | ----------------------------------------------- |
| `success` | boolean   | True if all inventories were saved successfully |


## Related topics

- [Save dirty inventory](/jaksam-inventory/functions/server/save-dirty-inventory.md)
- [Server](/jaksam-inventory/functions/server/index.md)
- [Commands](/jaksam-inventory/guides/commands.md)
- [Weapon Attachments](/jaksam-inventory/guides/weapon-attachments.md)
- [Customize Default Theme](/jaksam-inventory/guides/customize-theme.md)
