> 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.md).

# Advanced Treasure Hunter

Treasure maps, metal detection and digging with configurable rewards, XP and levels.

Treasure maps, metal detection and digging with configurable rewards, XP and levels.

## Requirements

**oxmysql** and the **skv\_metaldetector** prop resource. ESX, QBCore or Qbox; inventory support for ox\_inventory, qb-inventory or ESX default inventory. ox\_target/qb-target are optional; drawtext interaction is included. **ox\_lib is optional** and only needed when selected for notifications.

## Installation

{% stepper %}
{% step %}

### Install the resource and prop

Keep the folder name `tn_treasurehunter`. Install the [Metal Detector Prop](https://forum.cfx.re/t/metal-detector-prop-free/5131723) as `skv_metaldetector`.
{% endstep %}

{% step %}

### Database and items

Import `install/treasurehunter.sql`. Register all eight tool/map items and the configured reward items; copy `install/itemimages/*.png` into your inventory images folder. See **Items & inventory** below for definitions.
{% endstep %}

{% step %}

### Start and configure

```cfg
ensure oxmysql
ensure skv_metaldetector
ensure tn_treasurehunter
```

Start the framework, inventory and chosen interaction/notify resources first. Adjust `config.lua` and restart.
{% endstep %}
{% endstepper %}

## Gameplay

Visit the treasure hunter NPC, buy a shovel, detector and map, then use the map. Follow the parchment marker, locate the exact spot with the detector, dig and open the chest for rewards and XP.

During digging, press **Space** or **E** over soft soil; **Escape** cancels. Better shovels make the minigame easier. Maps are consumed after a successful dig; each chest can be looted once.

## Technical documentation

* [Configuration, locations & rewards](https://tn-modifications.gitbook.io/tn-modifications/tn_treasurehunter/configuration.md)
* [Items & inventory](https://tn-modifications.gitbook.io/tn-modifications/tn_treasurehunter/items.md)
* [Exports & integration](https://tn-modifications.gitbook.io/tn-modifications/tn_treasurehunter/exports.md)


---

# 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.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.
