> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/gta-the-crane-job/the-run.md).

# The Run

One run exists server-wide at a time. It moves through fixed stages, and every transition is a server callback that re-validates what the player claims to be doing.

***

### Stages

| Stage        | The crew                                            | Server checks                                                                     |
| ------------ | --------------------------------------------------- | --------------------------------------------------------------------------------- |
| `prep`       | Job accepted, flatbed spawning                      | Cooldown, crew size, police count                                                 |
| `fetch`      | Collect the flatbed from the depot                  | Caller is in the driver seat                                                      |
| `load`       | Lift the crane with the forklift, set it on the bed | Forklift within `liftRadius`, truck on the loading bay and squared with the crane |
| `return`     | Drive the loaded flatbed to the car park            | Free drive                                                                        |
| `delivering` | Bed slides back, tips, crane rolls off              | Truck within `truckRadius` of its bay                                             |
| `staged`     | Park a car on the tow marker                        | Car on the marker, caller driving it                                              |
| `lifting`    | Run the arm out and haul the vault into the open    | Leader drives the clip                                                            |
| `dropped`    | Rope the vault to the parked car                    | Player near the chest, tow car alive                                              |
| `towing`     | Drag the chest to the buyer                         | Chest and player inside `dropoffRadius`                                           |
| `done`       | Hand it over, everyone is paid                      | Payout landed for at least one member                                             |

Blips, bay markers and prompts follow the current stage on their own. Anyone further than `cfg.heist.sceneDistance` from the yard skips the cinematics and sees the finished state instead, so a late joiner never finds the crane frozen mid-swing.

***

### Starting

Depending on `cfg.heist.start.method`:

* **Fixer NPC.** Walk up, `[E] Talk` or the target option, then *Ask about the job*.
* **C4.** Stick a sticky bomb on the office wall. The explosion type and the radius around `cfg.scene.coords.wall` are both config, so stray explosions are ignored.

A start is refused if a run is already live, the cooldown has not expired, the crew is under `crew.min`, or the police requirement is not met.

***

### Driving the crane

When the run reaches `lifting`, the crew leader is handed a remote prop and an on-screen controller:

| Key        | Action                  |
| ---------- | ----------------------- |
| Arrow up   | `EXTEND` / `BRING OVER` |
| Arrow down | `RETRACT` / `EASE BACK` |

The arm only moves while a key is held, and the percentage on the remote is the real clip position. Everyone else in range watches it move live. There are two legs: reaching into the office, then carrying the vault out to the parking. Each can be manual or automatic (see cfg.lua Reference).

{% hint style="info" %}
If the leader disconnects mid-lift, leadership passes to the next crew member and the leg restarts for them. The run does not collapse.
{% endhint %}

***

### The tow

Rope the chest to whatever car the crew parked on the marker, then drive. The chest is a real physics object on a rope of `ropeLength` metres: it drags, swings and follows the terrain. Take it to the drop-off, talk to the buyer, and the crew is paid.

***

### When things go wrong

The run repairs itself rather than dying:

| Problem                              | What happens                                             |
| ------------------------------------ | -------------------------------------------------------- |
| Flatbed destroyed                    | A replacement spawns at the depot, the stage rewinds     |
| Forklift destroyed                   | A new one spawns by the crane                            |
| Tow car despawned                    | Crew is told to bring another; the rope re-attaches      |
| Chest deleted mid-tow                | Stage returns to `dropped`, the rope item is refunded    |
| Crew all disconnect                  | Run ends as `abandoned`                                  |
| Nothing happens for `abandonMinutes` | Run ends as `abandoned`                                  |
| Resource stopped                     | Every spawned entity is deleted and the state is cleared |

Both outcomes are written to `rm_cranejob_runs` and posted to Discord if a webhook is configured.
