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

# Force open inventory

> Forces an inventory to be opened for a specific player without permission checks.

Forces an inventory to be opened for a specific player without permission checks.

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

  ```lua Example theme={null}
  -- Open a stash for a player
  local playerId = 1
  exports['jaksam_inventory']:forceOpenInventory(playerId, 'police_stash_1')

  -- Open another player's inventory (search/rob)
  local targetPlayerId = 2
  exports['jaksam_inventory']:forceOpenInventory(playerId, targetPlayerId)

  -- Open inventory from a custom menu/UI
  RegisterNetEvent('myresource:openCustomStorage', function(storageId)
      local playerId = source
      exports['jaksam_inventory']:forceOpenInventory(playerId, storageId)
  end)
  ```
</CodeGroup>

### Parameters

| Name          | Data Type        | Description                                                                           |
| ------------- | ---------------- | ------------------------------------------------------------------------------------- |
| `playerId`    | number           | The server ID of the player who will see the inventory                                |
| `inventoryId` | string \| number | The inventory ID to open. Can be a player server ID (number) or inventory ID (string) |

### Return value

None.


## Related topics

- [Server](/jaksam-inventory/functions/server/index.md)
- [Is inventory open](/jaksam-inventory/functions/client/is-inventory-open.md)
- [Open inventory](/jaksam-inventory/functions/client/open-inventory.md)
- [Commands](/jaksam-inventory/guides/commands.md)
- [Set inventory disabled](/jaksam-inventory/functions/client/set-inventory-disabled.md)
