> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/free-resources/mango-notify/configuration/prompts.md).

# Prompts

Answer window, how many can stack, the key slots players can rebind, and the action colours.

Everything under `Config.Prompt` in `config.lua` controls [Interactive Prompts](/mango5m-docs/free-resources/mango-notify/developer-guide/interactive-prompts.md) — the notification cards players answer with a keybind.

{% hint style="info" %}
**The whole block is optional.** If `Config.Prompt` is missing — say you carried a `config.lua` over from 1.1.x — prompts run on the built-in defaults shown on this page. Add the block when you want to change them.
{% endhint %}

## Behaviour

```lua
Config.Prompt = {
    Duration      = 15000,  -- default answer window (ms)
    MaxActive     = 3,      -- how many prompts can be open at once
    Sound         = true,   -- false = prompts are silent
    PressFlash    = 160,    -- ms the chosen key chip flashes before the card leaves
    CancelOnDeath = true,   -- resolve every open prompt with nil when the player dies
    Priority      = 5,      -- prompts are never queued behind ordinary notifications
}
```

| Option          | Default | What it does                                                                                                      |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `Duration`      | `15000` | Used when a prompt does not pass its own `duration`. A prompt always has a deadline — it can never be persistent. |
| `MaxActive`     | `3`     | A new prompt past this cap resolves the **oldest** one with `nil` to make room.                                   |
| `Sound`         | `true`  | Turns off the prompt sound without affecting other notifications. `Config.SoundEnabled` still wins.               |
| `PressFlash`    | `160`   | How long the answered key chip flashes before the card leaves. `0` or `false` removes the effect.                 |
| `CancelOnDeath` | `true`  | Clears open prompts on death, so nobody respawns holding a stale question.                                        |
| `Priority`      | `5`     | Prompts never wait behind queued notifications, and are never evicted to make room for one.                       |

{% hint style="info" %}
**`PressFlash` is what separates an answer from a timeout.** Without it a prompt the player answered and a prompt that simply ran out both end the same way — the card leaves. With it, the chip they hit pops and brightens while the other actions fade back, so the choice is visibly acknowledged. It only delays the card's exit; your callback still fires the instant the key goes down.
{% endhint %}

## Key slots

Slots are registered as real FiveM key bindings. The `key` below is the **default** — each player can rebind it under **Settings → Key Bindings → FiveM**, and the prompt card shows their binding rather than the letter you set here.

```lua
    UseKeyMapping = true,
    Slots = {
        { key = 'E', control = 38 },
        { key = 'X', control = 73 },
        { key = 'G', control = 47 },
        { key = 'H', control = 74 },
    },
```

An action asking for `key = 'E'` is matched to the slot whose key is `E`. Add a fifth entry here and it becomes available to every script automatically.

{% hint style="info" %}
`E` and `X` are the two most contested keys in FiveM, which is exactly why they are slots. A player who already uses `E` for something else can move the prompt binding without you changing a line of config, and without breaking scripts that ask for `key = 'E'`.
{% endhint %}

Set `UseKeyMapping = false` to skip the bindings entirely and read the raw controls instead — prompts still work, players just cannot rebind them.

## Other keys

Any key that is not a slot falls back to a raw control from this table. These work in any prompt without touching `Slots`, but they are not rebindable by the player.

```lua
    Controls = {
        E = 38,  F = 23,  G = 47,  H = 74,  X = 73,  Q = 44,  R = 45,
        C = 26,  Z = 20,  B = 29,  Y = 246,
        ['1'] = 157, ['2'] = 158, ['3'] = 160, ['4'] = 164,
        ['5'] = 165, ['6'] = 159, ['7'] = 161, ['8'] = 162,
        SPACE = 22, ENTER = 191, TAB = 37, BACKSPACE = 194, DELETE = 178,
        LEFTSHIFT = 21, LEFTCTRL = 36, LEFTALT = 19,
        UP = 172, DOWN = 173, LEFT = 174, RIGHT = 175,
    },
```

They are standard GTA V control indices — add your own if you need a key that is not listed. An action asking for a key that is in neither table is skipped with a console warning.

```lua
    DisableConflicting = false,
```

Set this to `true` and the raw control is blocked from reaching the game while a prompt owns it, so answering with `E` does not also open a door or enter a vehicle. It has no effect on `Slots`, because a registered key binding cannot be suppressed.

## Action colours

```lua
    Styles = {
        success = '#2ECC71',
        danger  = '#FF4B4B',
        warning = '#F59E0B',
        info    = '#3B82F6',
    },
```

These colour the key chip when an action passes a matching `style`. An action with no style, or one that is not listed here, uses the notification's accent colour.

Retuning these four is the way to restyle every prompt on the server at once. An individual action can still opt out by passing its own `color`, which takes precedence over both the style and the accent — see [Interactive Prompts](/mango5m-docs/free-resources/mango-notify/developer-guide/interactive-prompts.md).

{% hint style="info" %}
The prompt card's own icon, accent and sound come from `Config.Types.prompt`, alongside every other notification type — see [Types & Accents](/mango5m-docs/free-resources/mango-notify/configuration/types-and-accents.md).
{% endhint %}
