> 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-advanced-hunting/faq-and-troubleshooting.md).

# FAQ & Troubleshooting

## Installation

* **"cas\_fwlibs export cannot be fetched"** — ensure `cas_fwlibs` starts before `cas-hunting`.
* **Database errors** — set your oxmysql `mysql_connection_string`, import `hunting.sql`, and use `utf8mb4`.
* **NUI blank** — F8 -> `clear`, restart; verify the `nui/` folder and `ui_page 'nui/index.html'` + `files { "nui/**/*" }` in `fxmanifest.lua`.
* **Items missing** — re-run the SQL, restart `vorp_inventory`, check names match (case-sensitive).

## Gameplay

* **Animals not spawning** — accept a contract, be within the marked radius, enable `Config.DebugMode` to see spawn logs.
* **Animals underground/in air** — adjust the contract `radiusCoords` Z or reduce `radius`; the system uses `PlaceEntityOnGroundProperly()`.
* **Kill cam not working** — `Config.KillCam.Enabled = true`, must be an active hunt on a mission animal, respect the 2.5s cooldown.
* **Tracking finds nothing** — need an active contract, animals within `Config.TrackRadius` (200), `TrackingSettings.Enabled = true`; debug with `/tracktest`.
* **Bait not attracting** — be in the contract radius, animals within `AttractionRadius` (150).
* **XP not saving** — XP saves every 60s / on disconnect / on stop; check the DB and character id; force with `/loadp`.

## Contracts

* **Not completing** — correct species, perfect pelt if required, required kill count met; deliver at the NPC with **L**.
* **"Trophies don't match contract"** — wrong species or a variant hash mismatch; check the contract animals.
* **"This contract requires perfect pelts"** — hunt 3-star animals with the correct weapon and a clean headshot.

## Performance

* Lower animal `amount` maxes, increase `FOOTPRINT.spawnInterval`, or disable the kill cam. Ensure DB indexes exist.

## Debug tools

| Command         | Purpose                  |
| --------------- | ------------------------ |
| `/tracktest`    | Tracking system status   |
| `/toggledebug`  | NUI debug overlay        |
| `/loadp`        | Reload player data       |
| `/hlset 1000`   | Set XP for testing       |
| `/traceset 500` | Set trace XP for testing |

With `Config.DebugMode = true`, look for `[CAS Debug]`, `[Tracking]` and `[cas-hunting]` console output.
