> ## Documentation Index
> Fetch the complete documentation index at: https://ugcore.urging.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> Custom statuses and hiding the HUD from your resources.

Client All exports run on the client.

## Custom statuses

Show your own bar in the status widget, such as drunk, nitro or radiation. Players can hide it and change its color like any other status.

```lua theme={"dark"}
exports['ug-hud']:AddStatus('drunk', { label = 'Drunk', icon = 'beer', color = '#facc15', value = 0 })
exports['ug-hud']:SetStatus('drunk', 40)
exports['ug-hud']:RemoveStatus('drunk')
```

**name** `string` *required*

1 to 32 letters, digits, dashes or underscores.

**label** `string` *required*

1 to 32 characters.

**icon** `string`

An icon name. Known: `beer`, `brain`, `droplet`, `droplets`, `flame`, `footprints`, `heart`, `pill`, `radiation`, `shield`, `skull`, `snowflake`, `sparkles`, `thermometer`, `utensils`, `waves`, `wind`, `zap`. Others show a dot.

**color** `string`

A hex color such as `#ff8800`.

**value** `number`

0 to 100, clamped.

* `AddStatus` raises on bad input. Calling it again with the same name updates the status.
* A status belongs to the resource that added it. Other resources cannot change or remove it: `SetStatus` and `RemoveStatus` return `false`.
* At most 16 custom statuses exist at once.
* Statuses are removed when their resource stops.
* A status is display only. Keep the real value in your resource, on the server when it matters.

## Hiding the HUD

```lua theme={"dark"}
exports['ug-hud']:SetHidden(true)  -- during your menu, cutscene or character screen
exports['ug-hud']:SetHidden(false)
exports['ug-hud']:IsVisible() -> boolean
```

Each resource hides for itself. The HUD shows again once every resource that hid it called `SetHidden(false)` or stopped. It also hides on its own in the pause menu, on faded screens and before a character is loaded.

## Needs and money

ug-hud reads needs and balances from ug-core. Change them with [`UgCore.Needs`](https://ugcore.urging.ch/api/needs) and [`UgCore.Accounts`](https://ugcore.urging.ch/api/accounts) on the server, and the HUD follows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.