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

# Igris Wildplants

<figure><img src="https://2862342791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFnkzyjlqOP6UGw1GyN62%2Fuploads%2FPyIIjHx85FjjtfJFeQsM%2Fwildplants.png?alt=media&amp;token=d4b01357-5fd3-422a-917d-3b6074e3f449" alt=""><figcaption></figcaption></figure>

igris\_wildplants  adds wild plants to gather across the map on RedM VORP servers. 25 harvest spots are configured out of the box, with 5 plants each (125 plants). Each picked plant respawns after a cooldown.

| Requirement                           | Status   | Notes                               |
| ------------------------------------- | -------- | ----------------------------------- |
| RedM server (cerulean, rdr3, Lua 5.4) | Required |                                     |
| vorp\_core                            | Required | Notifications, character loading    |
| vorp\_inventory                       | Required | Rewards, tool durability (metadata) |
| vorp\_progressbar                     | Required | Harvest progress bar                |
| Discord webhook URL                   | Optional | Harvest logs                        |

No database table is needed: only items are added. `config.lua` is left open (escrow\_ignore), so every spot, reward and text can be edited. The rest of the code is protected by Tebex escrow.

### Installation

Installation takes about five minutes: copy the folder, import the items, copy one image and add the `ensure` line.

1. Download the resource from your Tebex / CFX Portal account (Keymaster → Granted Assets).
2. Place the `igris_wildplants` folder in your `resources` directory. Do not rename it.
3. Import `sqlplantesauvage.sql` into your database. It adds 23 items: 20 wild plants, stone (`pierre`), stick (`baton`) and the scissors tool.
4. The file uses `INSERT IGNORE`, so items you already have are skipped instead of causing an error.
5. Labels are in French by default (for example `Sauge sauvage`). Rename them in the file or in your `items` table if needed.
6. Add the 3 illegal plant rewards if your server does not have them yet. They are used by the Cocaine, Marijuana and Opium spots but are not in the SQL file:

```sql
INSERT IGNORE INTO `items` (`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `metadata`, `desc`, `weight`) VALUES
("cocaine", "Coca Leaves", 20, 1, "item_standard", 0, "{}", "Wild plants", 0.1),
("weed", "Marijuana", 20, 1, "item_standard", 0, "{}", "Wild plants", 0.1),
("opium", "Opium", 20, 1, "item_standard", 0, "{}", "Wild plants", 0.1);
```

5. Copy `img/scissors.png` to `vorp_inventory/html/img/items/` so the scissors item has an icon.
6. Open `config.lua`:
7. Set `Config.defaultlang` to `"en_lang"`, `"fr_lang"` or `"de_lang"` (default is French).
8. Paste your Discord webhook in `Config.Discord.Webhook`, or set `Enabled = false`.
9. Add the resource to your `server.cfg` after its dependencies:

```
ensure vorp_core
ensure vorp_inventory
ensure vorp_progressbar
ensure igris_wildplants
```

8. Restart the server. The console prints `[igris_wildplants] Script créé par igris` when the resource starts.
9. Test in game: open the map, go to a plant blip, stand next to a plant and hold G.

Plants spawn about 15 seconds after a character is selected. After restarting the resource, players need to reconnect (or reselect their character) to see the plants again.

### Gameplay

Players walk up to a plant, hold G, and receive 1 to 3 items after a short animation.

1. Stand within 2 m of a plant: a prompt shows the plant name.
2. Hold **G**: the character kneels and a progress bar runs for `PickupTime` seconds (5 s by default).
3. The server checks the cooldown, inventory space and tool, then gives a random amount between `ItemMin` and `ItemMax`.
4. The plant disappears for every player and respawns after its `Cooldown` (25 s by default).

Harvest spots are shown on the map with a plant blip. The Cocaine, Marijuana and Opium spots have no blip by default, so players have to find them.

#### Scissors tool (optional)

Set `Config.Tool.Enabled = true` to require scissors for every harvest. Each harvest uses 1 durability point out of `MaxDurability` (20 by default). The remaining durability shows in the item tooltip, and the scissors break at 0. A plant on cooldown never uses durability.

### Configuration reference

Everything is in `config.lua`: general settings at the top, then one block per harvest spot in `Config.FarmSpots`.

#### General settings

| Setting               | Default      | What it does                                                |
| --------------------- | ------------ | ----------------------------------------------------------- |
| Config.defaultlang    | `"fr_lang"`  | Language: `en_lang`, `fr_lang`, `de_lang`                   |
| Config.Debug          | `false`      | Spawns plants 5 s after resource start, for testing         |
| Config.GlobalCooldown | `10`         | Respawn time (s) for spots without their own `Cooldown`     |
| Config.Discord        | enabled      | `Webhook`, `Username`, `Avatar` for harvest logs            |
| Config.Tool           | disabled     | `Enabled`, `Item` (`scissors`), `MaxDurability` (20)        |
| Config.Locales        | fr / en / de | Every player-facing text; add a language by copying a block |

#### Included spots

25 spots: wild sage, wild onion, wild cherry, bison berries, wild berries, red fruit, prairie root, wild nuts, mushrooms, yarrow, echinacea, mint, willow bark, mullein, chamomile, licorice root, American ginseng, nettle, juniper, Indian tobacco, stone, stick, plus coca (Cocaine), marijuana and opium.

#### Spot options (Config.FarmSpots)

| Key        | Example                                                                                   | What it does                             |
| ---------- | ----------------------------------------------------------------------------------------- | ---------------------------------------- |
| Name       | `'Sauge Sauvage'`                                                                         | Name shown in the prompt and Discord log |
| PlantProp  | `'alaskanginseng_p'`                                                                      | Prop spawned at each plant position      |
| Blip       | `{ Active = true, BlipSprite = 'blip_plant', BlipScale = 1.0, Coords = ..., Name = ... }` | Map blip for the spot                    |
| Cooldown   | `25`                                                                                      | Respawn time in seconds                  |
| Plants     | `{ { Coords = vector3(...) }, ... }`                                                      | Positions of each plant in the spot      |
| PickupTime | `5`                                                                                       | Harvest duration in seconds              |
| Reward     | `{ Item = 'sauges', Label = 'Sauge sauvage', ItemMin = 1, ItemMax = 3 }`                  | Item given and random amount             |

To add a spot, copy a block, change its name, prop, coordinates and reward, and add the reward item to your database:

```lua
{
    Name = 'Wild Lavender',
    PlantProp = 'alaskanginseng_p',
    Blip = { Active = true, BlipSprite = 'blip_plant', BlipScale = 1.0, Coords = vector3(0.0, 0.0, 0.0), Name = 'Wild Lavender' },
    Cooldown = 60,
    Plants = {
        { Coords = vector3(0.0, 0.0, 0.0) },
        { Coords = vector3(0.0, 0.0, 0.0) },
    },
    PickupTime = 5,
    Reward = { Item = 'lavender', Label = 'Wild Lavender', ItemMin = 1, ItemMax = 2 },
},
```

Keep at least 0.25 m between two plants: plants are identified by their coordinates.

### Troubleshooting

| Problem                                           | Fix                                                                                                       |
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| No plants in the world                            | Wait about 15 s after character selection; after a resource restart, reconnect or reselect your character |
| Plant floats or is under the ground               | Adjust the Z value of that plant's `Coords`                                                               |
| Plant prop does not appear                        | The `PlantProp` model name is wrong; use a valid RDR2 prop name                                           |
| Harvest gives nothing                             | The reward item is missing from the `items` table (check `cocaine`, `weed`, `opium`, Installation step 4) |
| "Inventory full"                                  | The player reached the item `limit` or carry weight                                                       |
| "You need a tool to harvest"                      | `Config.Tool.Enabled = true` and the player has no `scissors`                                             |
| Scissors have no icon                             | Copy `img/scissors.png` to `vorp_inventory/html/img/items/`                                               |
| Texts show a key name (for example `PickupPlant`) | `Config.defaultlang` does not match a language in `Config.Locales`                                        |
| No progress bar                                   | `vorp_progressbar` is missing or started after igris\_wildplants                                          |
| No Discord logs                                   | `Config.Discord.Enabled = true` and a valid URL instead of `url_webhooks`                                 |

Still stuck? Open a ticket on our Discord with your server and F8 console logs.
