---
name: "terminate"
type: command
status: ok
groups: ["Program Flow"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/terminate
revid: 376945
updated: 2025-12-31T22:54:37Z
---

# terminate

*Command · Program Flow · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

## Description

Terminates (aborts) [spawn](../commands/spawn.md)ed or [execVM](../commands/execVM.md)ed script.

> [!IMPORTANT]
> The given script will not terminate immediately upon [terminate](../commands/terminate.md) command execution, it will do so the next time the script is processed by the [scheduler](../topics/Scheduler.md)

## Syntax

### Syntax 1

```sqf
terminate scriptHandle
```

**Parameters:**

- `scriptHandle`: [Script Handle](../topics/Script_Handle.md)

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

*since arma3 2.18*

```sqf
terminate FSMHandle
```

**Parameters:**

- `FSMHandle`: [Number](../topics/Number.md) - The FSM script must be launched with 'allowTermination' flag for this command to work (see [execFSM](../commands/execFSM.md)).

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 3

*since arma3 2.22*

```sqf
scriptHandle terminate result
```

**Parameters:**

- `scriptHandle`: [Script Handle](../topics/Script_Handle.md) - Only ["Empty Handle"](../topics/Script_Handle.md#promise_handles)'s can have their result set.
- `result`: [Anything](../topics/Anything.md) - The result to write into the [Promise](../topics/Script_Handle.md#promise_handles)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
_script = [] execVM "script.sqf";
sleep 5;
terminate _script;
```

## See also

[execVM](../commands/execVM.md) · [spawn](../commands/spawn.md) · [scriptDone](../commands/scriptDone.md) · [halt](../commands/halt.md) · [execFSM](../commands/execFSM.md)

<sub>Source: [BI Community Wiki — terminate](https://community.bistudio.com/wiki/terminate) (revision 376945).</sub>
