> For the complete documentation index, see [llms.txt](https://striga.gitbook.io/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/docs/striga-core/events.md).

# Events

Local events Striga Core fires. Listen instead of calling the API every frame.

All events are **local**: listen with `AddEventHandler` (not `RegisterNetEvent`).

## Both sides

| Event                        | Args         | When                                                                      |
| ---------------------------- | ------------ | ------------------------------------------------------------------------- |
| `striga-core:ready`          | -            | Core is ready (systems picked)                                            |
| `striga-core:adapterChanged` | `kind, name` | A system changed after ready (for example your adapter loaded or stopped) |

## Client

| Event                                                    | Args         | When                                                       |
| -------------------------------------------------------- | ------------ | ---------------------------------------------------------- |
| `striga-core:client:playerLoaded`                        | `profile`    | Character loaded                                           |
| `striga-core:client:playerUnloaded`                      | -            | Character left                                             |
| `striga-core:client:profileChanged`                      | `key, value` | Money, job, gang, name... changed                          |
| `striga-core:client:needsChanged`                        | `needs`      | Hunger, thirst or stress changed                           |
| `striga-core:client:inventoryChanged`                    | -            | Items changed                                              |
| `striga-core:client:inventoryOpened` / `inventoryClosed` | -            | Inventory UI opened / closed                               |
| `striga-core:client:itemListChanged`                     | -            | Item definitions changed                                   |
| `striga-core:client:settingsChanged`                     | `id, values` | Settings of a script changed (`values = nil` when removed) |
| `striga-core:client:theme`                               | `theme`      | Suite theme changed (`nil` = cleared)                      |
| `striga-core:client:locale`                              | `code`       | Server language changed (sent by core)                     |

## Server

| Event                                 | Args                                   | When                                                        |
| ------------------------------------- | -------------------------------------- | ----------------------------------------------------------- |
| `striga-core:server:playerLoaded`     | `src, profile`                         | Character loaded                                            |
| `striga-core:server:playerUnloaded`   | `src`                                  | Logout or drop                                              |
| `striga-core:server:profileChanged`   | `src, key, value`                      | `job`, `gang`, `money`, `name`, `metadata`, `staff` changed |
| `striga-core:server:inventoryChanged` | `src`                                  | Items changed                                               |
| `striga-core:server:itemUsed`         | `src, name, item`                      | Player used an item                                         |
| `striga-core:server:moneyChanged`     | `src, account, amount, action, reason` | Money added / removed / set                                 |
| `striga-core:server:itemListChanged`  | -                                      | Item definitions changed                                    |
| `striga-core:locale`                  | `code`                                 | Server language changed (`SetLocale` / `/strigalocale`)     |

`GlobalState.strigaLocale` holds the active code. Clients read it on join.

## Examples

```lua
-- client: keep cash in a local, no polling
local cash = 0
AddEventHandler('striga-core:client:profileChanged', function(key, value)
    if key == 'money' then cash = value.cash end
end)

-- client: follow the suite theme
AddEventHandler('striga-core:client:theme', function(theme)
    applyAccent(theme and theme.accent or myDefaultColor)
end)

-- client: the settings hub changed a provider
AddEventHandler('striga-core:client:settingsChanged', function(id, values)
    if id == 'my-script' and values then print('new size', values.size) end
end)
```

{% content-ref url="/pages/hQDHOfkNTkRbgocruljk" %}
[Troubleshooting & FAQ](/docs/striga-core/troubleshooting-and-faq.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/docs/striga-core/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.
