> 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/fire-sync.md).

# Fire sync

### ⚠️ Technical Limitations

* This script works **only with entities recognized as synchronized by RedM**.
* **Due to RedM limitations**, you cannot generate an unlimited number of fires in the same area.
  * If you go over the engine’s cap, you’ll only see a single flame on the burning entity.
* For gameplay, the system still allows plenty of room for action and chaos.

***

### 🟧 Server Side

You can generate a fire on the floor or on a wall/window using this server event:

```lua
-- Server Side
TriggerEvent('BTFire:createFire', fireType, impactCoords, radius, timeOutInSeconds)
```

* `fireType`: `"wall"` or `"floor"`
* `impactCoords`: `vector3(x, y, z)`
* `radius`: number (e.g. `8`)
* `timeOutInSeconds`: number (e.g. `15`)

### 🟦 Client Side

You can request fire generation from the client:

```lua
-- Client Side
TriggerServerEvent('BTFire:createFire', fireType, impactCoords, radius, timeOutInSeconds)
```

***

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

```lua
Config = {}
Config.DEBUG           = false   -- Debug mode (gives fire weapons/ammo, prints debug info)
Config.AllowInside     = true    -- Allow fire inside buildings
Config.fireTimeOut     = 30      -- Fire is extinguished after this many seconds
Config.AllowOnPlayers  = true    -- Players can set fire to other players

-- Fire Mod
-- Note: More flames = fewer visible fires in the area (engine limitation).
Config.FireMod         = 1       -- 1 = moderate fire, 2 = increased fire

-- Weapons List
Config.WeaponsList = {
    { weapon = "WEAPON_THROWN_MOLOTOV", minRadius = 4, maxRadius = 6 },
    -- more weapons...
}

-- Ammos List
Config.AmmoList = {
    { ammo = "AMMO_PISTOL_EXPRESS_EXPLOSIVE", minRadius = 1, maxRadius = 2 },
    -- more ammos...
}

-- Discord Logging
Config.DiscordWebhook   = "" -- Discord webhook URL
Config.DiscordName      = "BT_FIRE" -- Name shown in Discord messages
```

***

### 📌 Notes

* 🔥 Fire can be triggered **on walls/windows** or **on the ground** with the correct `fireType`.
* 🧑‍🚒 Fire is temporary and will extinguish automatically after the configured time, or if limited by the engine.
* 🧨 Both throwable weapons and explosive ammo can be configured to generate fire when used.
* 📢 All major notifications and fire events can be logged to Discord using the webhook system.


---

# 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/fire-sync.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.
