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