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

# Configuration

Two files: `config.lua` for everything a player sees, `server_config.lua` for the Discord webhook. Both ship commented.

### config.lua

| Setting                 | Default | Description                                                               |
| ----------------------- | ------- | ------------------------------------------------------------------------- |
| `Config.Locale`         | `'en'`  | Language of all texts. `'en'` or `'de'`.                                  |
| `Config.VersionCheck`   | `true`  | Checks for a newer version on start, see Installation.                    |
| `Config.RespawnDelay`   | `300`   | Seconds a player stays dead before the respawn button unlocks.            |
| `Config.HoldToRespawn`  | `2.0`   | Seconds the respawn button has to be held. `0` makes it an instant click. |
| `Config.ShowMedicCount` | `true`  | Shows how many medics are on duty.                                        |
| `Config.ShowDeathCause` | `true`  | Shows the cause of death. Never a killer name, only the cause.            |

### The two timers

There is one ring on the screen and it runs two countdowns after each other, never at the same time. First `Config.RespawnDelay` seconds until the respawn button unlocks, then `Config.AutoRespawn.time` seconds until the player is respawned automatically.

```lua
Config.AutoRespawn = {
    enabled = true,
    time = 600
}
```

`enabled = false` removes the second countdown. The player then waits out the respawn delay and respawns whenever they want.

### Early respawn

While the respawn delay still runs, the greyed out button stays clickable and respawning costs money.

```lua
Config.EarlyRespawn = {
    enabled = true,
    price = 5000,
    account = 'bank'
}
```

`account` is `'bank'` or `'money'` for cash, and the price is charged on the server. A price of `0` makes the early respawn free, nothing is charged and no price message is shown. `enabled = false` locks the button until the delay is over.

### The screen effect

Everything the player sees of the world while they are down is one table, and every part of it can be turned off on its own. All of it is restored on a respawn and on a revive.

```lua
Config.Timecycle = {
    enabled = true,
    modifier = 'REDMIST',
    strength = 0.75,
    fadeIn = 3.0,
    pulse = {
        enabled = true,
        amount = 0.2,
        speed = 3.0
    },
    postfx = 'DeathFailOut',
    motionBlur = true,
    extra = {
        modifier = 'CAMERA_BW',
        strength = 0.65
    }
}
```

| Field        | Description                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------- |
| `modifier`   | Game timecycle modifier that tints the screen. `''` for none.                                               |
| `strength`   | How hard it is applied, `0.0` to `1.0`.                                                                     |
| `fadeIn`     | Seconds it fades in over. `0` puts it there instantly.                                                      |
| `pulse`      | Swings the strength up and down like a heartbeat. `amount` is how far, `speed` is the seconds for one beat. |
| `postfx`     | Screen effect played on top. `''` for none.                                                                 |
| `motionBlur` | Blurry vision while down.                                                                                   |
| `extra`      | A second modifier layered on top, by default the one that takes the colour out.                             |

Modifiers that suit a death screen: `REDMIST` for a heavy red haze, `damage` for subtler red edges, `dying` for a washed out grey, `Bloom` for a soft white bloom, `prologue_ending_fog` for cold grey fog and `NEW_ARREST` for a desaturated blue. For the `extra` layer: `CAMERA_BW` for black and white, `NG_blackout` for almost blacked out and `glasses_darkgreen` for a green tint. Other `postfx` values are `DeathFailOut`, `DeathFailMPDark`, `DeathFailMPIn` and `MP_Bull_tost`.

`enabled = false` leaves the picture untouched.

### The HUD while the player is down

```lua
Config.Hud = {
    hideMinimap = true,
    hideHud = true
}
```

| Field         | Description                                                                                  |
| ------------- | -------------------------------------------------------------------------------------------- |
| `hideMinimap` | Hides the minimap for the whole time the player is dead.                                     |
| `hideHud`     | Calls `Func.HideHud()` when the player goes down and `Func.ShowHud()` once they are back up. |

Both come back on a respawn, on a revive, on a logout and when the resource stops, so the HUD is never left hidden.

The two functions sit in the client part of `shared/functions.lua`. The Hexscripts HUD (`hex_finalhud_v2`) is wired in already and simply skipped when it is not running. For any other HUD put its export or event into both functions:

```lua
function Func.HideHud()
    TriggerEvent('hud:client:hide')
end

function Func.ShowHud()
    TriggerEvent('hud:client:show')
end
```

The event names above are only an example, use the ones your HUD offers. An error in there never blocks the death screen, it only shows up in the F8 console.

{% hint style="info" %}
If your HUD script forces the minimap on every frame, `hideMinimap` cannot win against it. Hide the minimap through your HUD in `Func.HideHud()` instead.
{% endhint %}

### The cursor key

```lua
Config.Keys = {
    focus = { enabled = true, control = 22, label = 'SPACE' }
}
```

The cursor is on when the screen opens, because the buttons are clicked with the mouse. Pressing this key hides it so the mouse moves the death camera, pressing it again brings it back. `control` is a FiveM control id, `label` is the key name printed in the hint line, so change both together.

With `enabled = false` the buttons cannot be clicked at all and only the automatic respawn is left. Only use that if you want a death screen nobody can act on.

### Respawn points

```lua
Config.RespawnPoints = {
    { coords = vec3(341.0, -1397.3, 32.5), heading = 48.5 },
    { coords = vec3(1836.03, 3670.99, 34.28), heading = 296.06 }
}
```

The point closest to where the player died is used. These are l-deathscreen's own points, the ones in esx\_ambulancejob are not read any more, so keep them in sync if you move a hospital.

### server\_config.lua

```lua
ServerConfig.Logs = {
    enabled = false,
    webhook = '',
    botName = 'l-deathscreen',
    avatar = '',
    color = 16729670
}
```

Logged are every death with its cause and position, every medic call and every paid early respawn. `color` is the embed colour as a decimal number. Keep this file server side, the webhook never belongs in `config.lua`.

### Colours

Every colour of the screen is a CSS variable in `html/style.css`. Edit the file, restart the resource, done. Every colour is a variable in that file.
