> For the complete documentation index, see [llms.txt](https://tn-modifications.gitbook.io/tn-modifications/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tn-modifications.gitbook.io/tn-modifications/tn_treasurehunter/configuration.md).

# Configuration, locations & rewards

Configure providers, dig spots, map tiers, shovels, XP and rewards.

Edit `config.lua` and restart after changes. Append examples to the existing tables.

## Framework and interactions

```lua
Config.Framework = 'auto' -- auto, esx, qb, qbox
Config.Inventory = 'auto' -- auto, ox, qb, esx
Config.Target = 'drawtext' -- auto, ox_target, qb-target, drawtext
Config.Notify = 'nui' -- built-in; no extra notify resource
Config.Locale = 'en'
```

`Config.NPC` sets the shop NPC model, coordinates/heading and blip. The shop uses framework **cash**. `auto` framework detection checks Qbox before QBCore.

## Add a dig spot

```lua
Config.DigSpots[#Config.DigSpots + 1] = vec3(245.77, 3639.33, 31.44)
```

Replace this with a reachable ground location. Parchment marker coordinates are calculated automatically; no manual image coordinates are required.

## Add rewards to a map tier

```lua
Config.Maps.rare.rewards[#Config.Maps.rare.rewards + 1] = {
    item = 'diamond', min = 1, max = 3
}
Config.Maps.rare.rewardCount = 2
Config.Maps.rare.xp = 100
```

Register `diamond` in the selected inventory. By default, one reward entry is selected; `rewardCount` selects multiple entries without replacement, capped by pool size. Each selected entry gives a random integer between `min` and `max`.

Reward entries go through `Bridge.AddItem`. `money` is paid as framework cash with the QB and ESX-default bridges. With the Ox bridge it is an inventory item; register it or adjust rewards for your server.

## Add a map tier

```lua
Config.Maps.legendary = {
    item = 'map_legendary', price = 2000, minLevel = 15, xp = 200,
    chest = 'prop_ld_int_safe_01',
    rewards = { { item = 'gold', min = 3, max = 8 } }
}
Config.Minigame.tierSpeed.legendary = 1.3
```

Register `map_legendary` and its image. For Ox, use `client.export = 'tn_treasurehunter.useMap'`; the item name must follow **`map_<tier>`**. Add the item label to each needed locale (`map_legendary` key).

## Add a shovel

```lua
Config.Shovels.steel = {
    item = 'shovel_steel', price = 2000, minLevel = 15,
    minigame = { rounds = 3, speed = 0.85, zone = 0.24, misses = 2 }
}
```

Register the item/image and locale label. `rounds` is the layer count (1–10), `speed` the blade speed, `zone` the soft-soil width fraction (0–1), and `misses` the allowance. The script chooses the held shovel with the highest configured `minLevel`.

## Progression and cooldowns

| Setting                     | Default / behavior                                                                |
| --------------------------- | --------------------------------------------------------------------------------- |
| `Config.XpPerLevel`         | 500; next-level requirement = current level × this value.                         |
| `Config.MapCooldown`        | 1800 seconds per player/map tier; successful digging clears that tier's cooldown. |
| `Config.DetectorRadius`     | 80 metres.                                                                        |
| `Config.Minigame.roundTime` | 6 seconds per soil layer.                                                         |
| `Config.Minigame.tierSpeed` | Blade speed multiplier per tier.                                                  |

An active map can be reopened for the same hunt. XP/levels persist in `treasurehunt_levels`.


---

# 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://tn-modifications.gitbook.io/tn-modifications/tn_treasurehunter/configuration.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.
