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

# Dynamite

### ⚡ First Start

1. Make sure your core/inventory supports the item name set in `Config.ItemName` (default: `kit_dynamite`).
2. For other frameworks, use the provided client/server events to trigger dynamite placement and fire.

***

### 🟦 Client Side

* **Place dynamite & fire** (Other frameworks):

  ```lua
  TriggerEvent("BTFire:placeFire")
  ```
* **Manually trigger a fire at coordinates**:

  ```lua
  TriggerEvent("BTFire:placeDynamiteAtCoords", vector3(3288.76, -1282.01, 50.76))
  ```

***

### 🟧 Server Side

* **Ask a specific player to place dynamite/fire**:

  ```lua
  TriggerClientEvent("BTFire:placeFire", source)
  ```
* **Manually trigger fire for a player at specific coordinates**:

  ```lua
  TriggerClientEvent("BTFire:placeDynamiteAtCoords", source, vector3(3288.76, -1282.01, 50.76))
  ```

***

### ⚙️ Configuration Highlights (`config.lua`)

* **General**
  * `Config.ItemName` – Name of the inventory item required to place dynamite (VORP only).
  * `Config.DEBUG` – Enables debug mode for easy testing.
* **Prompts & Keys**
  * Customizable prompt texts and keybinds for all main actions (placing, detonating, cancel, water/bucket, etc).
* **Fire Parameters**
  * `Config.AllowOutside`, `Config.FireMinOutside`, `Config.FireMaxOutside`\
    → Number and location of fire sources.
  * `Config.EnableFireSmoke` – Add visible flames and smoke.
  * `Config.AllowExtinguish`, `Config.BucketRadius` – Allow players to extinguish fire with water.
* **Dynamite Parameters**
  * `Config.WireLength` – Length of detonator wire (min 10.0).
  * `Config.ExplodeTime` – Time in seconds before explosion (can be randomized).
  * `Config.ShowCountDown`, `Config.CountDownStyle` – Explosion countdown display options.
* **Discord**
  * Webhook support for explosion logs/alerts.
* **Text Messages**

  ```lua
  Config.Txt = {
      TooFar = "Warning, you are going too far, the wire might break.",
      TooFarGone = "The wire has broken"
  }
  ```

***

### 📦 Features

* Players can place dynamite, run a detonator via wire, and create a fire that persists until extinguished or server reboot.
* Fire is **extinguishable** with water if allowed in config.
* Compatible with VORP, RedEM, RSGCore and other major frameworks (via notification helpers).
* Multiple fire and smoke effects, adjustable for inside/outside buildings.

***

### 🟧/🟦 Events & Exports

* **Trigger fire from client:**

  ```lua
  TriggerEvent("BTFire:placeFire")
  TriggerEvent("BTFire:placeDynamiteAtCoords", vector3(x, y, z))
  ```
* **Trigger fire from server:**

  ```lua
  TriggerClientEvent("BTFire:placeFire", source)
  TriggerClientEvent("BTFire:placeDynamiteAtCoords", source, vector3(x, y, z))
  ```

***

### 📌 Notes

* If you go too far from the detonator wire, it will break and the dynamite won’t explode (`Config.Txt.TooFar`, `Config.Txt.TooFarGone`).
* Fire persists even after explosion until players put it out or the server is restarted.
* All prompts, keybinds, and texts are fully customizable in `config.lua`.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://botiv.gitbook.io/rdr2/dynamite.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
