> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-metabolism-v2/troubleshooting.md).

# Troubleshooting

Fix common CAS Metabolism V2 issues on RedM — HUD not showing, needs not saving, items doing nothing, and the body-weight direction check.

## The HUD does not appear

Join and stand in the world for a few seconds first — it stays off the character selection and creation screens on purpose.

If it is still missing, turn on `Config.Debug.enabled` and type `/hudwhy`. It prints every rule and which one is hiding it:

```
shown            false
manual           false
char screen      true      ← this one
sprinting        false
```

`char screen true` after you have spawned means a creator fired its "opening" event and never fired its "done" event. Add the right event name to `Config.Hud.characterScreen.releases`.

***

## The HUD appears on the character creator

Add your creator's events to the config:

```lua
Config.Hud.characterScreen = {
    enabled = true,
    covers   = { 'your-creator:client:open' },
    releases = { 'your-creator:client:done' },
}
```

***

## Needs reset every time I restart

Check the console on start. If you see:

```
[cas-metabolism] the table `xxx` exists but has no `identifier` and `payload` columns, so nothing can be saved to it.
```

another resource already owns that table name. Change `Config.Table` to something else and restart.

***

## Nothing saves at all

`oxmysql` must start before this resource. Check your `server.cfg` order, and look for:

```
[CAS-Metabolism] Persistence table `cas_metabolism_v2` is ready.
```

No such line means the database was not reachable at start.

***

## An item does nothing when used

1. The item name in the config must match the inventory database **exactly** — `apple` is not `Apple` and not `consumable_apple`.
2. It must be in the file for your framework — `items_vorp.lua` or `items_rsg.lua`, not the other one.
3. Restart after editing. Item registration happens on start.

***

## Health never drops when hunger and thirst hit zero

Type `/needs` with debug on:

```
thirst       0.00  EMPTY  lethal
health       600 / 600
taking       3.00% of max, every 10s
dead in      333 seconds
```

If `lethal` is missing, that need has `lethal = false` in the config. If `taking` says `0.00%`, its `damage` is set to zero.

***

## The character gets narrower as they gain weight

RDR2 does not document which way its body shapes run, so this has to be checked once per server:

```lua
Config.Weight.buildReverse = true
```

Test it with `/weight 100` and `/weight 0`.

***

## Two metabolism scripts at once

If you still run another hunger/thirst resource, stop it. Both will write to the same player health and force the same walk animations, and the result looks like each one is broken.

***

## The drunk walk overrides a walk style from another menu

It should not — the drunk *stumble* rides on top of whatever walk the player picked. If you turned the walk style back on:

```lua
Config.Blackboard.drunk.styleAt = nil    -- leave the player's own walk alone
```

***

## Still stuck

Set `Config.Debug.enabled = true`, reproduce it, and send the output of the command closest to the problem — `/hudwhy`, `/needs`, `/temp`, `/weight` or `/metabolismnatives`. Turn it back off afterwards.
