---
name: "scriptNull"
type: command
status: ok
groups: ["Variables"]
arma3_since: "1.32"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/scriptNull
revid: 363804
updated: 2024-04-21T18:03:23Z
---

# scriptNull

*Command · Variables · Arma 3 v1.32*

## Description

A non-existing or [completed](../commands/scriptDone.md) [Script Handle](../topics/Script_Handle.md). To compare non-existent scripts use [isNull](../commands/isNull.md) or [isEqualTo](../commands/isEqualTo.md):

```sqf
scriptNull == scriptNull;            // ERROR! == cannot be used with script object
isNull scriptNull;                    // true
scriptNull isEqualTo scriptNull;    // true
```

## Syntax

```sqf
scriptNull
```

**Returns:** [Script Handle](../topics/Script_Handle.md) - NULL script

## Examples

### Example 1

Wait until previous script is finished before starting a new one:

```sqf
0 spawn
{
    _script = scriptNull;
    for "_i" from 1 to 10 do
    {
        waitUntil { isNull _script };
        _script = _i spawn
        {
            hint format ["script %1 started", _this];
            sleep 1;
            hint format ["script %1 finished", _this];
            sleep 0.2;
        };
    };
};
```

### Example 2

```sqf
if (scriptDone (_obj getVariable ["TAG_objScript", scriptNull])) then
{
    _scriptHandle = _obj spawn { waitUntil { damage _this > 0.9 }; hint "Critical Damage!"; };
    _obj setVariable ["TAG_objScript", _scriptHandle];
};
```

### Example 3

```sqf
str scriptNull; // <NULL-script>
```

## See also

[controlNull](../commands/controlNull.md) · [displayNull](../commands/displayNull.md) · [grpNull](../commands/grpNull.md) · [locationNull](../commands/locationNull.md) · [objNull](../commands/objNull.md) · [taskNull](../commands/taskNull.md) · [teamMemberNull](../commands/teamMemberNull.md) · [configNull](../commands/configNull.md) · [typeName](../commands/typeName.md) · [isNull](../commands/isNull.md) · [scriptDone](../commands/scriptDone.md) · [spawn](../commands/spawn.md) · [execVM](../commands/execVM.md)

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