---
name: "scriptDone"
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/scriptDone
revid: 321342
updated: 2022-05-13T19:10:40Z
---

# scriptDone

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

## Description

Check if a script is finished running using the [Script Handle](../topics/Script_Handle.md) returned by [execVM](../commands/execVM.md) or [spawn](../commands/spawn.md).

## Syntax

```sqf
scriptDone handle
```

**Parameters:**

- `handle`: [Script Handle](../topics/Script_Handle.md) - handle returned by [spawn](../commands/spawn.md) or [execVM](../commands/execVM.md)

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

## Examples

### Example 1

```sqf
_scriptHandle = ["arguments"] execVM "scriptname.sqf";
waitUntil { scriptDone _scriptHandle };
```

## See also

[execVM](../commands/execVM.md) · [spawn](../commands/spawn.md) · [terminate](../commands/terminate.md) · [scriptNull](../commands/scriptNull.md)

## Community notes

**Bn880** — 2009-09-11

A Null Script handle can be created in this manner:

```sqf
_handle = 0 spawn {};
```

That is what any [Script Handle](../topics/Script_Handle.md) becomes when a script is finished running, meaning it will test as [true](../commands/true.md) with:

```sqf
scriptDone _handle;
```

and it returns "<NULL-script>" when converted to string.
This in turn lets you initialize the variable with a completed [Script Handle](../topics/Script_Handle.md) and lets you test the variable even though nothing else may have set the handle by creating a script with [spawn](../commands/spawn.md) or [execVM](../commands/execVM.md).
It also lets you store and manage script handles in arrays, and a few other sexy things.

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