---
name: "Event Scripts"
type: topic
aliases: ["Event based scripts", "Init.sqs", "Initintro.sqs", "init.sqf", "init.sqs", "onPlayerRespawn.sqf"]
source: https://community.bistudio.com/wiki/Event_Scripts
revid: 377939
updated: 2026-01-11T17:03:24Z
---

# Event Scripts

__NOTOC____NOEDITSECTION__

|  |  |  |
|---|---|---|
| + Default Scripts Location | Game | Path |
| Operation Flashpoint v1.00 | `DTA/scripts.pbo` |  |
| Armed Assault v1.00 | `Ca.pbo/data/scripts` |  |
| Arma 2 v1.00 |  |  |
| Arma 2: Operation Arrowhead v1.50 |  |  |
| Arma 3 v1.00 | `functions_f.pbo/scripts` |  |
| Take On Helicopters v1.00 | `data_h.pbo/data/scripts` |  |

Event Scripts are scripts that are executed upon specific events. Not all event scripts are executed directly by the engine.

To use an Event Script, create a file of the given name in the mission directory.

| init* scripts | (on)Player* scripts | Other Scripts |
|---|---|---|
| - [#init.sqf](../topics/Event_Scripts.md#init-sqf)<br>- [#init.sqs](../topics/Event_Scripts.md#init-sqs)<br>- [#init3DEN.sqf](../topics/Event_Scripts.md#init3den-sqf)<br>- [#initIntro.sqf](../topics/Event_Scripts.md#initintro-sqf)<br>- [#initIntro.sqs](../topics/Event_Scripts.md#initintro-sqs)<br>- [#initJIPcompatible.sqf](../topics/Event_Scripts.md#initjipcompatible-sqf)<br>- [#initPlayerLocal.sqf](../topics/Event_Scripts.md#initplayerlocal-sqf)<br>- [#initPlayerServer.sqf](../topics/Event_Scripts.md#initplayerserver-sqf)<br>- [#initServer.sqf](../topics/Event_Scripts.md#initserver-sqf) | - [#onPlayerKilled.sqf](../topics/Event_Scripts.md#onplayerkilled-sqf)<br>- [#onPlayerKilled.sqs](../topics/Event_Scripts.md#onplayerkilled-sqs)<br>- [#onPlayerRespawn.sqf](../topics/Event_Scripts.md#onplayerrespawn-sqf)<br>- [#onPlayerRespawn.sqs](../topics/Event_Scripts.md#onplayerrespawn-sqs)<br>- [#onPlayerRespawnAsSeagull.sqs](../topics/Event_Scripts.md#onplayerrespawnasseagull-sqs)<br>- [#onPlayerRespawnOtherUnit.sqs](../topics/Event_Scripts.md#onplayerrespawnotherunit-sqs)<br>- [#onPlayerResurrect.sqs](../topics/Event_Scripts.md#onplayerresurrect-sqs)<br>- [#playerKilledScript.sqs](../topics/Event_Scripts.md#playerkilledscript-sqs)<br>- [#playerRespawnScript.sqs](../topics/Event_Scripts.md#playerrespawnscript-sqs)<br>- [#playerRespawnSeagullScript.sqs](../topics/Event_Scripts.md#playerrespawnseagullscript-sqs)<br>- [#playerRespawnOtherUnit.sqs](../topics/Event_Scripts.md#playerrespawnotherunit-sqs)<br>- [#playerResurrectScript.sqs](../topics/Event_Scripts.md#playerresurrectscript-sqs) | - [#exit.sqf](../topics/Event_Scripts.md#exit-sqf)<br>- [#exit.sqs](../topics/Event_Scripts.md#exit-sqs)<br>- [#missionFlow.fsm](../topics/Event_Scripts.md#missionflow-fsm)<br>- [#onFlare.sqs](../topics/Event_Scripts.md#onflare-sqs)<br>- [#pauseOnLoad.sqf](../topics/Event_Scripts.md#pauseonload-sqf)<br>- [#teamSwitchScript.sqs](../topics/Event_Scripts.md#teamswitchscript-sqs) |

> [!NOTE]
> - See [Initialisation Order](../topics/Initialisation_Order.md) to learn when initialisation scripts are executed.
> - Additional initialisation scripts can be executed using functions with [preInit or postInit](../topics/Functions_Library.md#attributes) attribute.

### Available Scripts

| File | Present in | Details |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|
| Operation Flashpoint v1.00 | Operation Flashpoint: Resistance v1.75 | Armed Assault v1.00 | Arma 2 v1.00 | Arma 2: Operation Arrowhead v1.50 | Arma 3 v1.00 | Take On Helicopters v1.00 | Can [suspend](../commands/canSuspend.md) |  |
| #### exit.sqf<br>Executed when mission is finished (before debriefing screen).<br>In Arma 3, see also ["Ended"](../topics/Mission_Event_Handlers.md#ended) and ["MPEnded"](../topics/Mission_Event_Handlers.md#mpended) [Mission Event Handlers](../topics/Mission_Event_Handlers.md).<br>```sqf<br>params ["_endType"];<br>```<br>- endType: [String](../topics/String.md) |  |  |  | ✓ | ✓ | ✓ | ✓ | ✓ |
| #### exit.sqs<br>Executed when mission is finished (before debriefing screen).<br>In Arma 3, see also ["Ended"](../topics/Mission_Event_Handlers.md#ended) and ["MPEnded"](../topics/Mission_Event_Handlers.md#mpended) [Mission Event Handlers](../topics/Mission_Event_Handlers.md).<br>```sqf<br>params ["_endType"];<br>```<br>- endType: [String](../topics/String.md) |  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |  |
| #### init.sqf<br>Executed when mission is started (before briefing screen). |  |  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| #### init.sqs<br>Executed when mission is started (before briefing screen). | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |  |
| #### init3DEN.sqf<br>Executed when loading a scenario in Eden Editor if the file is present. Useful for executing scenario-specific editor functionality. |  |  |  |  |  | ✓ |  | ✗ |
| #### initIntro.sqf<br>Executed when intro, outro win or outro lose is started.<br>> [!NOTE]<br>> **Arma 3:** Functional in Arma 3 only for intro. |  |  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| #### initIntro.sqs<br>Executed when intro, outro win or outro lose is started.<br>> [!NOTE]<br>> **Arma 3:** Functional in Arma 3 only for intro. |  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |  |
| #### initJIPcompatible.sqf<br>Executed locally by Arma 2: Multiplayer Framework when a player joins mission (includes both mission start and JIP). Also executed locally on server at mission start. |  |  |  | ✓ | ✓ |  |  |  |
| #### initPlayerLocal.sqf<br>Executed locally when player joins mission (includes both mission start and JIP). See [Initialisation Order](../topics/Initialisation_Order.md) for details about when exactly the script is executed.<br>```sqf<br>params ["_player", "_didJIP"];<br>```<br>- player: [Object](../topics/Object.md)<br>- didJIP: [Boolean](../topics/Boolean.md) |  |  |  |  |  | ✓ |  | ✓ |
| #### initPlayerServer.sqf<br>Executed only on server when a player joins mission (includes both mission start and JIP). See [Initialisation Order](../topics/Initialisation_Order.md) for details about when exactly the script is executed.<br>This script relies on [BIS_fnc_execVM](../functions/BIS_fnc_execVM.md) and [remoteExec](../commands/remoteExec.md). If CfgRemoteExec's `class Functions` is set to mode = 0 or 1, the script will never be executed.<br>Therefore, `initPlayerServer.sqf` should be avoided - use [this method](https://www.reddit.com/r/armadev/comments/8fkitd/initplayerserversqf_therefore_initplayerserversqf/dy5k5pf/) instead.<br>```sqf<br>params ["_playerUnit", "_didJIP"];<br>```<br>- playerUnit: [Object](../topics/Object.md)<br>- didJIP: [Boolean](../topics/Boolean.md) |  |  |  |  |  | ✓ |  | ✓ |
| #### initServer.sqf<br>Executed only on server when mission is started. See [Initialisation Order](../topics/Initialisation_Order.md) for details about when exactly the script is executed. |  |  |  |  |  | ✓ |  | ✓ |
| #### missionFlow.fsm<br>Executed on post-init when mission is started. See [BIS_fnc_missionFlow](../functions/BIS_fnc_missionFlow.md). |  |  |  |  |  | ✓ |  |  |
| #### onFlare.sqs<br>Executed when a flare is lit after being fired from grenade launcher.<br>```sqf<br>params ["_colorRGB", "_shooter", "_projectile", "_instigator"];<br>```<br>- colorRGB: [Color (RGBA)](../topics/Color.md)<br>- shooter: [Object](../topics/Object.md)<br>- Arma 3 v2.10 projectile: [Object](../topics/Object.md) - the flare itself<br>- Arma 3 v2.18 instigator: [Object](../topics/Object.md) - shot instigator |  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |  |
| #### onPlayerKilled.sqf<br>Executed when player is killed in singleplayer or in multiplayer mission.<br>```sqf<br>params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];<br>```<br>- oldUnit: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- respawnType: [Number](../topics/Number.md)<br>- respawnDelay: [Number](../topics/Number.md) |  |  |  |  |  | ✓ |  | ✓ |
| #### onPlayerKilled.sqs<br>Executed when player is killed in singleplayer or in multiplayer mission with "NONE" [respawn type](../topics/Description.ext.md#respawn).<br>```sqf<br>params ["_player", "_killer"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ |  |
| #### onPlayerRespawn.sqf<br>Executed locally when player respawns in a multiplayer mission.<br>This event script will also fire at the beginning of a mission if [respawnOnStart](../topics/Description.ext.md#respawnonstart) is 0 or 1, oldUnit will be [objNull](../commands/objNull.md) in this instance.<br>This script will not fire at mission start if [respawnOnStart](../topics/Description.ext.md#respawnonstart) equals -1.<br>```sqf<br>params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"];<br>```<br>- newUnit: [Object](../topics/Object.md)<br>- oldUnit: [Object](../topics/Object.md)<br>- respawnType: [Number](../topics/Number.md)<br>- respawnDelay: [Number](../topics/Number.md) |  |  |  |  |  | ✓ |  | ✓ |
| #### onPlayerRespawn.sqs<br>Executed when player is killed in multiplayer mission with "INSTANT" or "BASE" [respawn type](../topics/Description.ext.md#respawn). It will not work if *dta\scripts\onPlayerRespawn.sqs* does not exist.<br>```sqf<br>params ["_player", "_killer", "_respawnDelay"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- respawnDelay: [Number](../topics/Number.md) |  | ✓ |  |  |  |  |  |  |
| #### onPlayerRespawnAsSeagull.sqs<br>Executed when player is killed in multiplayer mission with "SEAGULL" [respawn type](../topics/Description.ext.md#respawn), or when the type is "GROUP" or "SIDE", but no remaining respawn slots are left.<br>This script will replace the default respawn sequence.<br>> [!NOTE]<br>> **Arma 3:** `onPlayerRespawnAsSeagull.sqs` was renamed to `1. playerRespawnSeagullScript.sqs` in Arma 3.<br>```sqf<br>params ["_player", "_killer", "_seagull"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- seagull: [Object](../topics/Object.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ |  |
| #### onPlayerRespawnOtherUnit.sqs<br>Executed when player is killed in multiplayer mission with "GROUP" or "SIDE" [respawn type](../topics/Description.ext.md#respawn). This script will replace the default respawn sequence.<br>> [!NOTE]<br>> **Arma 3:** `onPlayerRespawnOtherUnit.sqs` was renamed to `1. playerRespawnOtherUnit.sqs` in Arma 3.<br>```sqf<br>params ["_player", "_killer", "_newUnit"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- newUnit: [Object](../topics/Object.md) | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ |  |
| #### onPlayerResurrect.sqs<br>Executed when player is respawned in multiplayer mission with "INSTANT" or "BASE" [respawn type](../topics/Description.ext.md#respawn). It will not work if `dta\scripts\onPlayerResurrect.sqs` does not exist.<br>> [!NOTE]<br>> **Arma 3:** `onPlayerResurrect.sqs` was renamed to `1. playerResurrectScript.sqs` in Arma 3.<br>```sqf<br>params ["_player"];<br>```<br>- player: [Object](../topics/Object.md) |  | ✓ |  |  |  | ✗ |  |  |
| #### pauseOnLoad.sqf<br>Executed when pause menu is activated.<br>To make it work in MP or Arma 3, use `onPauseScript = "pauseOnLoad.sqf";` in [Description.ext](../topics/Description.ext.md#onpausescript).<br>```sqf<br>params ["_pauseMenuDisplay"];<br>```<br>- pauseMenuDisplay: [Display](../topics/Display.md) |  |  |  | ✓ | ✓ |  | ✓ | ✓ |
| #### playerKilledScript.sqs<br>Executed locally when player is killed in singleplayer or in multiplayer mission with "NONE" [respawn type](../topics/Description.ext.md#respawn).<br>Overrides default behavior of mission death screen in single player. Game may become unplayable if not scripted correctly. Avoid use if not experienced with this script.<br>```sqf<br>params ["_player", "_killer"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md) |  |  |  |  |  | ✓ |  |  |
| #### playerRespawnScript.sqs<br>Executed locally and immediately when player is killed in multiplayer mission with "BASE" or "INSTANT" [respawn type](../topics/Description.ext.md#respawn).<br>Overrides default behavior of multiplayer respawn. Game may become unplayable if not scripted correctly. Avoid use if not experienced with this script.<br>```sqf<br>params ["_player", "_killer", "_respawnDelay"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- respawnDelay: [Number](../topics/Number.md) |  |  |  |  |  | ✓ |  |  |
| #### playerRespawnSeagullScript.sqs<br>Executed when player is killed in multiplayer mission with "SEAGULL" [respawn type](../topics/Description.ext.md#respawn), or when the type is "GROUP" or "SIDE", but no remaining respawn slots are left.<br>This script will replace the default respawn sequence.<br>> [!NOTE]<br>> **Arma 3:** `1. onPlayerRespawnAsSeagull.sqs` was renamed to `playerRespawnSeagullScript.sqs` in Arma 3.<br>```sqf<br>params ["_player", "_killer", "_seagull"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- seagull: [Object](../topics/Object.md) | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |  |
| #### playerRespawnOtherUnit.sqs<br>Executed when player is killed in multiplayer mission with "GROUP" or "SIDE" [respawn type](../topics/Description.ext.md#respawn). This script will replace the default respawn sequence.<br>> [!NOTE]<br>> **Arma 3:** `1. onPlayerRespawnOtherUnit.sqs` was renamed to `playerRespawnOtherUnit.sqs` in Arma 3.<br>```sqf<br>params ["_player", "_killer", "_newUnit"];<br>```<br>- player: [Object](../topics/Object.md)<br>- killer: [Object](../topics/Object.md)<br>- newUnit: [Object](../topics/Object.md) | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |  |
| #### playerResurrectScript.sqs<br>Executed when player is respawned in multiplayer mission with "INSTANT" or "BASE" [respawn type](../topics/Description.ext.md#respawn). It will not work if `dta\scripts\onPlayerResurrect.sqs` does not exist.<br>> [!NOTE]<br>> **Arma 3:** `1. onPlayerResurrect.sqs` was renamed to `playerResurrectScript.sqs` in Arma 3.<br>```sqf<br>params ["_player"];<br>```<br>- player: [Object](../topics/Object.md) | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |  |
| #### teamSwitchScript.sqs<br>Executed *after* a Team Switch is done. **Not** triggered by [selectPlayer](../commands/selectPlayer.md).<br>```sqf<br>params ["_oldUnit", "_newUnit"];<br>```<br>- oldUnit: [Object](../topics/Object.md)<br>- newUnit: [Object](../topics/Object.md) | ✗ |  |  |  |  | ✓ |  |  |

<sub>Source: [BI Community Wiki — Event Scripts](https://community.bistudio.com/wiki/Event_Scripts) (revision 377939).</sub>
