> For the complete documentation index, see [llms.txt](https://acestudios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acestudios.gitbook.io/docs/roleplay/advanced-knockout/configuration.md).

# Configuration

Configure knockout triggers, armor physics, immunities and webhooks.

All settings are in `ace_knockout/config.lua`. Chances are decimals from `0.0` to `1.0`: `0.4` = 40%, `1.0` = always.

## General

| Option                      | Type    | Default  | Values                                                                                                                                                                |
| --------------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Framework`          | string  | `'auto'` | `'auto'`, `'qbcore'`, `'qbox'`, `'esx'`, `'standalone'`                                                                                                               |
| `Config.NotificationSystem` | string  | `'auto'` | `'auto'`, `'qb'`, `'esx'`, `'ox_lib'`, `'okok'`, `'mythic'`. See the note in [Installation](/docs/roleplay/advanced-knockout/installation.md#notification-detection). |
| `Config.Debug`              | boolean | `false`  | Debug prints for troubleshooting.                                                                                                                                     |

## Knockout

```lua
Config.Knockout = {
    DurationMin = 20,
    DurationMax = 40,
    HealthThreshold = 120,
    ScreenEffects = true,
}
```

| Option            | Default | Description                                 |
| ----------------- | ------- | ------------------------------------------- |
| `DurationMin`     | `20`    | Minimum knockout time in seconds.           |
| `DurationMax`     | `40`    | Maximum knockout time in seconds.           |
| `HealthThreshold` | `120`   | Below this HP, a knockout is highly likely. |
| `ScreenEffects`   | `true`  | Blur, vignette and black & white effects.   |

## Triggers

`Config.Triggers`. Every trigger has `Enabled`.

| Trigger          | Option                   | Default | Description                                                                   |
| ---------------- | ------------------------ | ------- | ----------------------------------------------------------------------------- |
| **Melee**        | `BaseChance`             | `0.4`   | Chance of passing out from a melee hit.                                       |
|                  | `HeadshotMultiplier`     | `2.0`   | Chance multiplier for melee hits to the head.                                 |
| **FallDamage**   | `MinHeight`              | `5.0`   | Minimum fall height in meters.                                                |
|                  | `BaseChance`             | `0.6`   | Chance when the height is reached.                                            |
| **VehicleCrash** | `MinSpeed`               | `100.0` | Minimum crash speed in km/h (100 km/h ≈ 60 mph).                              |
|                  | `BaseChance`             | `0.8`   | Chance on a qualifying crash.                                                 |
| **BloodLoss**    | `DamageThreshold`        | `40`    | Pass-out chance applies while bleeding below this HP.                         |
|                  | `BaseChance`             | `0.6`   | Chance.                                                                       |
| **Exhaustion**   | `HealthThreshold`        | `20`    | Pass-out chance applies below this HP when stamina reaches 0.                 |
|                  | `BaseChance`             | `0.2`   | Chance.                                                                       |
| **Drowning**     | `PreventInstantDeath`    | `true`  | Keeps the player at 105 HP underwater so EMS can rescue them.                 |
| **ArmorPhysics** | `HelmetDeflectionChance` | `0.85`  | Chance to survive a headshot while wearing a helmet, with a heavy concussion. |
|                  | `VestWindedChance`       | `0.45`  | Chance to be winded (ragdolled) by a shotgun or rifle blast to the vest.      |
|                  | `WindedDuration`         | `4000`  | Winded time in **milliseconds**.                                              |
| **Concussion**   | `Duration`               | `20`    | Seconds of concussion after waking up.                                        |
|                  | `DisableSprinting`       | `true`  | Stops sprinting while concussed.                                              |

## Dreaming

See [Dream Sequences](/docs/roleplay/advanced-knockout/dream-sequences.md) for all `Config.Dreaming` options.

## Immunities

```lua
Config.Immunities = {
    Jobs = { 'ambulance', 'police' },
}
```

Players with one of these job names are immune. This needs a framework, because standalone mode has no job lookup.

## Webhooks

```lua
Config.Webhooks = {
    Enabled = false,
    URL = 'YOUR_DISCORD_WEBHOOK_HERE',
    Color = 16711680 -- Red
}
```

| Option    | Description                      |
| --------- | -------------------------------- |
| `Enabled` | Turns Discord logging on or off. |
| `URL`     | Your Discord webhook URL.        |
| `Color`   | Embed color as a decimal number. |
