> For the complete documentation index, see [llms.txt](https://zsx-development.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://zsx-development.gitbook.io/docs/resources/user-interface-v2/exports/statuses.md).

# Statuses

In our UIV2 (version 2.9) you can handle status registers and unregisters through simple exports.

### Registering new status

In order to register status you need to use such export:

<pre class="language-lua"><code class="lang-lua"><strong>exports['ZSX_UIV2']:RegisterStatus(statusName, icon, defaultValue, getFunction)
</strong></code></pre>

#### Params explained

<table><thead><tr><th width="174">Parameter</th><th width="183">Type</th><th>About</th></tr></thead><tbody><tr><td>statusName</td><td><mark style="color:$success;">String</mark></td><td>Name of your status</td></tr><tr><td>icon</td><td><mark style="color:$success;">String</mark></td><td>Icon of your status</td></tr><tr><td>defaultValue</td><td><mark style="color:blue;">Number</mark></td><td>Default value of the status</td></tr><tr><td>getFunction</td><td><mark style="color:purple;">Function</mark></td><td>Function that returns value of the status</td></tr></tbody></table>

#### Example register of the status

Since it might be a bit confusing, here's an example how to properly register your status:

```lua
local statusName = "hygiene" -- name of the status
local icon = "fas fa-soap" -- icon of the status
local defaultValue = 100 -- default value of the status, 100 means max level
local getFunction = function()
    return exports['my-pseudo-status']:GetHygieneLevel() -- returns hygiene level from 
    --our pseudo resource called "my-pseudo-status" with export name of GetHygieneLevel()
end

exports['ZSX_UIV2']:RegisterStatus(statusName, icon, defaultValue, getFunction)
```

#### Be careful!

Make sure that all of the parameters uses proper types, such as strings, functions etc. and that getFunction parameter returns number values.

### Unregistering status

To properly unregister status you need to know the status name of it. Then you can easily call:

```lua
exports['ZSX_UIV2']:UnregisterStatus(statusName)
```

#### Params explained

<table><thead><tr><th width="174">Parameter</th><th width="183">Type</th><th>About</th></tr></thead><tbody><tr><td>statusName</td><td><mark style="color:$success;">String</mark></td><td>Name of your status</td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://zsx-development.gitbook.io/docs/resources/user-interface-v2/exports/statuses.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
