> For the complete documentation index, see [llms.txt](https://striga.gitbook.io/striga-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://striga.gitbook.io/striga-docs/striga-inventory/exports-and-events.md).

# Exports & Events

Use Striga Inventory from your own scripts.

{% hint style="success" %}
**Quick start (server)**

`exports['striga-inventory']:AddItem(source, 'water_bottle', 2)`\
`exports['striga-inventory']:RemoveItem(source, 'water_bottle', 1)`
{% endhint %}

{% hint style="info" %}
**Your qb scripts need no change.** `exports['qb-inventory']:AddItem(...)` and the other qb-inventory exports still work. See [QB Compatibility](/striga-docs/striga-inventory/qb-compatibility.md).
{% endhint %}

## Where things are

| Side   | What                                                                   | Page                                                                 |
| ------ | ---------------------------------------------------------------------- | -------------------------------------------------------------------- |
| Server | Item, open / close, stash, shop and drop exports; hooks; server events | [Server](/striga-docs/striga-inventory/exports-and-events/server.md) |
| Client | qb-inventory client events. No public client exports                   | [Client](/striga-docs/striga-inventory/exports-and-events/client.md) |

## The `inv` argument

Most server exports take `inv`:

| Value                | Means                          |
| -------------------- | ------------------------------ |
| `source` (number)    | That player's inventory        |
| `'stash:<name>'`     | A stash, e.g. `'stash:police'` |
| `'trunk:<plate>'`    | A vehicle trunk                |
| `'glovebox:<plate>'` | A vehicle glovebox             |

Bad input returns `false` / `nil` / `0`. Items are checked against your framework item list.

## The `target` argument

`OpenInventory(source, target)` takes a table `{ type, id }` or a container id string (like `'trunk:ABC123'`):

| `type`          | `id`       | Checks done for you                  |
| --------------- | ---------- | ------------------------------------ |
| `'player'`      | -          | Opens the player's own inventory     |
| `'stash'`       | stash name | Job groups and distance of the stash |
| `'otherplayer'` | server id  | -                                    |
| `'drop'`        | drop id    | -                                    |
| `'trunk'`       | plate      | -                                    |
| `'glovebox'`    | plate      | -                                    |

{% hint style="warning" %}
For `otherplayer`, `trunk` and `glovebox`, **your script** checks why the player may open it (police job, vehicle unlocked...).
{% endhint %}

## Through striga-core (recommended)

If your script already uses **striga-core**, use the core item functions. They work with whatever inventory the server owner runs, not only Striga Inventory. See [striga-core Exports](/striga-docs/striga-core/exports.md).

{% content-ref url="/pages/8UCLPyBpPfEKHltcM3vv" %}
[Server](/striga-docs/striga-inventory/exports-and-events/server.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://striga.gitbook.io/striga-docs/striga-inventory/exports-and-events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
