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

# Igris GoldSearch

<figure><img src="https://2862342791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFnkzyjlqOP6UGw1GyN62%2Fuploads%2FJuzJuEED4JkzaFvUv7CK%2Figris_goldsearch.png?alt=media&amp;token=21609198-b645-4918-9137-5650c464d11e" alt=""><figcaption></figcaption></figure>

### 1. Requirements

* An up-to-date **RedM** server
* **vorp\_core**
* **vorp\_inventory**
* **vorp\_progressbar**
* Access to your server's database (to add the items)

### 2. Installation

1. Unzip the archive and put the `igris_goldsearch` folder in your server's `resources` folder.
2. Add the 3 items to your database (see section 3).
3. In your `server.cfg`, start the resource **after** the VORP resources:

```
ensure vorp_core
ensure vorp_inventory
ensure vorp_progressbar
ensure igris_goldsearch
```

4. Open `config.lua` and, at the very least, set up the Discord webhook (see section 7).
5. Restart the server. You should see `[igris_goldsearch] Script created by igris` in the console.

### 3. Items to add (SQL)

Run this query on your database (vorp\_inventory's `items` table):

```sql
INSERT IGNORE INTO `items` (`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES
('seauor', 'Prospector''s Bucket', 1, 1, 'item_standard', 1, 'A bucket to collect river water.'),
('tablecraftor', 'Gold Sluice', 1, 1, 'item_standard', 1, 'A sluice box to set up by the water.'),
('pepiteor', 'Gold Nugget', 100, 1, 'item_standard', 0, 'A small gold nugget.');
```

| Item           | Purpose                                                | Usable |
| -------------- | ------------------------------------------------------ | ------ |
| `seauor`       | Bucket (take out / put away, wears down with each pan) | Yes    |
| `tablecraftor` | Sluice box to place on a spot                          | Yes    |
| `pepiteor`     | Gold nugget earned by panning                          | No     |

You can rename the items, but the names must be **identical** in the database and in `Config.Items`.

For icons, put `seauor.png`, `tablecraftor.png` and `pepiteor.png` in `vorp_inventory/html/img/items/`.

### 4. How it works in game

1. Go to a gold panning spot (icon on the map).
2. Use the **Sluice** item: it is placed in front of you.
3. Use the **Bucket** item to take it out.
4. Step into the water, inside the spot area, and hold **G** to fill the bucket.
5. Walk up to the sluice and hold **E** to pour the water.
6. Press **Enter** to pan: you get 1 to 3 nuggets (configurable).
7. To go again, refill the bucket and pour the water.
8. Near the sluice, hold **G** to pick it up (the item is returned to you). Use the Bucket item again to put it away.

Each pan uses up one of the bucket's uses. When it reaches 0, the bucket breaks and is removed from the inventory.

### 5. Configuration (config.lua)

The `config.lua` file is fully open and editable.

| Option                            | Default                              | Description                                             |
| --------------------------------- | ------------------------------------ | ------------------------------------------------------- |
| `Config.Debug`                    | `false`                              | Prints debug messages in the server console             |
| `Config.EventPrefix`              | `igris_goldsearch`                   | Prefix for network events                               |
| `Config.ProgressTheme`            | `linear`                             | Progress bar style: `linear`, `circle` or `innercircle` |
| `Config.ProgressTimes`            | 1.5 s to 6 s                         | Duration of each action, in milliseconds                |
| `Config.Items`                    | `seauor`, `tablecraftor`, `pepiteor` | Item names used by the script                           |
| `Config.BucketDurability.Enabled` | `true`                               | Turns bucket wear on or off                             |
| `Config.BucketDurability.MaxUses` | `20`                                 | Number of pans before the bucket breaks                 |
| `Config.Drop.SuccessChance`       | `100`                                | Chance (in %) of finding gold                           |
| `Config.Drop.Min` / `Max`         | `1` / `3`                            | Number of nuggets earned                                |
| `Config.ShowSpotBlips`            | `true`                               | Shows the spots on the map                              |

Tip: with `SuccessChance = 100`, every pan yields gold. Lower it (to 60, for example) for a more balanced economy.

### 6. Adding or editing a spot

Three spots are included (Dakota River, Kamassa River, Donner Falls). To add one, copy this block into `Config.Spots`:

```lua
{
    label = "Spot #4 - My spot",
    coords = { x = 0.0, y = 0.0, z = 0.0 },
    radius = 6.0,
    blip = { enabled = true, sprite = 214435071, scale = 0.2, name = "Gold Panning" }
},
```

* `coords`: center of the spot (on the riverbank or in the water)
* `radius`: size of the area in meters. Players must be inside it to place the sluice, fill the bucket and pan
* `blip`: map icon (set `enabled = false` to hide it)

### 7. Discord logs (webhook)

Every pan sends a log with: player and character name, steam and license identifiers, spot, number of nuggets and bucket wear.

1. In Discord: Channel settings → Integrations → Webhooks → New webhook → Copy URL.
2. Paste the URL in `config.lua`:

```lua
Config.Webhook = {
    enabled = true,
    url = "https://discord.com/api/webhooks/...",
```

If you don't want logs, set `enabled = false`. Don't leave the default `Url_Webhook` value with `enabled = true`.

Log titles, field names and colors can be changed in `Config.Webhook.texts`.

### 8. Translation

The script ships in French. All in-game texts (prompts, notifications, progress bar) are in `Config.Texts`, and the Discord log texts are in `Config.Webhook.texts`. Just edit the sentences between quotes. Keep the `%s` and `%d`: they are replaced by a number or an item name.

### 9. Troubleshooting

**Nothing happens when I use the items** Check that the item names in the database match `Config.Items`, that `usable` is set to 1 for the bucket and the sluice, and that the resource starts after vorp\_inventory.

**"You must be at a gold panning spot!"** You are outside the area. Move closer to the blip or increase the spot's `radius`.

**"You must be in the water!"** The bucket can only be filled while the character is standing in water.

**"Can't place the sluice here."** The ground in front of the player wasn't detected. Stand on flat ground, facing the riverbank.

**`vorp_progressbar` error in the console** vorp\_progressbar isn't installed, or it starts after the script.

**No Discord logs** Check the webhook URL and that `enabled = true`.
