> 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/resources/mango-prison/configuration/escapes.md).

# Escapes

Multi-stage escapes with smuggled tools, escalating alerts and real consequences.

Escaping Bolingbroke is a **multi-stage operation**, not a single interaction — and it is tuned semi-hard by default so breakouts stay rare, memorable events.

Everything is `config/escape.lua`.

## The default route

An escape target appears at the **start point** for active prisoners — the loose vent on the west wall of Block 6. From there:

| # | Stage                                                                      | Needs                    | Alert chance |
| - | -------------------------------------------------------------------------- | ------------------------ | ------------ |
| 1 | **Unscrew the vent cover** — Block 6, west wall                            | `screwdriver` (kept)     | 10%          |
| 2 | **Slip through the service passage** behind the garage — a 15-second crawl | —                        | 20%          |
| 3 | **Cut through the perimeter fence** — south-west wall, near tower 13       | `hacksaw` (**consumed**) | 60%          |

Complete all three, then **cross the boundary line**. The escape completes the moment you leave the boundary zone — not when the last stage finishes.

Then: a full prison lockdown (`autoLockdown`), the PA sounds, guards get an alert, and **police get a real dispatch call** at your last known position — see [Police Dispatch](/mango5m-docs/resources/mango-prison/features/police-dispatch.md).

## Stage anatomy

Stages use the same primitives as prison jobs. Add, remove or redesign them freely.

```lua
{
    id = 'vent', label = 'Unscrew the vent cover',
    coords = vec3(1677.8, 2450.5, 44.7), radius = 2.0,
    type = 'skillcheck',
    skillcheck = { difficulty = { 'medium', 'medium', 'hard' } },
    items = { { name = 'screwdriver', count = 1, remove = false } },
    anim = { dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@', clip = 'machinic_loop_mechandplayer' },
    alertChance = 10,
    alertText = 'Suspicious noise reported in Block 6.',
    minTime = 3,
},
```

| Field                   | Does                                                |
| ----------------------- | --------------------------------------------------- |
| `type`                  | `'skillcheck'` or `'progress'`                      |
| `duration`              | Progress length in ms                               |
| `skillcheck.difficulty` | ox\_lib difficulties, one entry per check           |
| `items`                 | Required items. `remove = true` consumes them       |
| `coords` / `radius`     | Where it happens — **position-checked server-side** |
| `alertChance`           | 0–100 chance guards are alerted on completion       |
| `minTime`               | Anti-cheat floor in seconds                         |

{% hint style="warning" %}
**`minTime` is a floor, not a duration — and it only covers the stage itself.** The prisoner is already standing at the vent when stage 1 begins, so its floor covers the skill check alone. Set a floor above the time its own task takes and a competent player is punished for being quick: the attempt is cancelled and their conduct marked, every time, no matter how well they play.

The shipped values are 3 / 12 / 10 against tasks that take roughly 3.5 s, 15 s and 12 s. Redesign a stage and re-check its floor.
{% endhint %}

## Cooldowns

```lua
cooldowns = {
    global    = 3600,   -- seconds between any two escapes, server-wide
    perPlayer = 7200,   -- before the same player may attempt again
    failReset = 900,    -- lockout after an aborted or failed attempt
},
```

The **per-player** cooldown starts when the attempt starts, not when it succeeds — so beginning an attempt commits you for two hours either way. The **global** cooldown is written to the database, so **it survives a resource restart**.

When an attempt is refused, the message names **which** cooldown and **how long** is left:

> *The whole place is still on edge after the last one. 42 minute(s).*
>
> *Not yet — you tried too recently. Lay low for 12 more minute(s).*

Those read very differently, and both beat a bare "lay low for a while" that tells nobody whether it is them or the whole prison.

Check and clear them from the console or in game:

```
/prison escapes
/prison escapes clear
```

`clear` lifts the server-wide cooldown **and** every per-player one. Because the global cooldown is persisted, this command is the only way to shift it — restarting the resource will not.

## Failing

A failed or abandoned attempt applies the `failReset` lockout, a behaviour hit, and a record entry. Attempting stages **out of order**, **too fast**, or **from the wrong place** fails the attempt outright.

A failed **skill check** does not: the stage simply resets its timer and can be retried. Only the structural checks end a run.

## What escaping means

Escaped inmates keep their prison blues and prisoner job, their property stays in storage, and their record is flagged **ESCAPED** on the terminal until they are recaptured.

`recapturePenaltyMinutes` (15) is stacked on top of their remaining sentence when they are jailed again — and they go through intake again, too.

## Crossing the boundary without an attempt

A prisoner who leaves the boundary zone with no active attempt is handled by `Config.Restrictions`:

* `boundaryAction = 'teleport'` (default) — dragged back to their cell, write-up, behaviour hit
* `boundaryAction = 'escape'` — treated as a successful escape

Either way the server verifies they really are outside before acting.

## Developer mode

Testing this route under production rules is close to impossible — two-hour lockouts, alert rolls locking the prison down mid-run, and a cancelled attempt for every fumble. With `Config.Developer = true`:

* **no cooldowns**, server-wide or per player
* **no alert rolls**
* **nothing is cancelled and no conduct is marked** — a failure is ignored and the attempt stays live
* **the timing and position floors are skipped**
* **one easy skill check** at every stage instead of the configured mix

The route, the items and the stage order are unchanged — the steps are the same steps, just survivable. See [Developer Mode](/mango5m-docs/resources/mango-prison/developer-guide/developer-mode.md).

## Turning it off

```lua
Config.Escape = { enabled = false }
```

No start target, no stages, no attempts. `Config.Restrictions.boundary` still governs prisoners who wander out.

{% hint style="warning" %}
The server validates every stage — order, minimum timings, item possession and position — and rolls the alert chances itself. The client reports what happened; it never decides what happens.
{% endhint %}
