> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# On mission failed

> Triggered server side when a mission fails.

Event triggered on mission fail.

```lua Event theme={null}
RegisterNetEvent("missions_creator:missionFailed", function(instanceId, missionId, players, reason)

end)
```

### Parameters

| Name         | Data Type | Description                                                  |
| ------------ | --------- | ------------------------------------------------------------ |
| `instanceId` | integer   | Unique session ID                                            |
| `missionId`  | integer   | Mission ID, the one you see in the admin menu                |
| `players`    | table     | Table containing the players who participated in the mission |
| `reason`     | string    | The reason the mission has failed                            |

<Note>
  Add this event in any server-side file you want to use it in.
</Note>


## Related topics

- [Server](/missions-creator/server/index.md)
- [On mission completed](/missions-creator/server/on-mission-completed.md)
- [On mission start](/missions-creator/server/on-mission-start.md)
- [Start a mission](/missions-creator/server/start-mission.md)
- [Missions Creator](/missions-creator/home.md)
