---
name: "BIS_fnc_setTask"
type: function
status: ok
groups: ["Tasks"]
arma3_since: "1.00"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_setTask
revid: 352179
updated: 2024-02-01T23:25:46Z
---

# BIS_fnc_setTask

*Function · Tasks · Arma 3 v1.00*

Locality: arguments **global** · effect **global**

## Description

Set task parameters.

Create the task when it doesn't exist. 

> [!NOTE]
> See Arma 3: Task Framework for more information.

## Syntax

```sqf
[taskId, target, description, (destination, state, priority, showNotification, isGlobal, type, visibleIn3D)] call BIS_fnc_setTask
```

**Parameters:**

- **taskId**:

  [String](../topics/String.md) - Task ID

  [Array](../topics/Array.md) -  In the format of [task ID, parent task ID]
- **target**: Task owner(s)

  [Boolean](../topics/Boolean.md) - true to set task of all playable units

  [Object](../topics/Object.md) - set task of a specific object

  [Group](../topics/Group.md) - set tasks of all objects in the group

  [Side](../topics/Side.md) - set tasks of all objects of the given side

  [Array](../topics/Array.md) - collection of above types
- **description**:

  [Array](../topics/Array.md) - Task description in the format ["description", "title", "marker"]

  [String](../topics/String.md) - [CfgTaskDescriptions](../topics/Description.ext.md#cfgtaskdescriptions) class name, if empty string is used then [CfgTaskDescriptions](../topics/Description.ext.md#cfgtaskdescriptions) is searched for a class matching the tasks TaskID
- **destination** (Optional): Task destination

  [Object](../topics/Object.md)

  [Array](../topics/Array.md) - either position in format [x,y,z], or [object,precision] as used by setSimpleTaskTarget command
- **state** (Optional): Task state

  [String](../topics/String.md) - can be one of following:

  "CREATED"

  "ASSIGNED"

  "AUTOASSIGNED" ("ASSIGNED" when no task is assigned yet, otherwise "CREATED")

  "SUCCEEDED"

  "FAILED"

  "CANCELED"

  [Boolean](../topics/Boolean.md) - true to set the task as current
- **priority** (Optional): [Number](../topics/Number.md) - priority. When a current task is completed, system select a next one with the larges priority >= 0
- **showNotification** (Optional): [Boolean](../topics/Boolean.md) - true to show notification (default), false to disable it
- **isGlobal** (Optional): [Boolean](../topics/Boolean.md) - true to set task globally (default), false to set it only locally
- **type** (Optional): [String](../topics/String.md) - task type from CfgTaskTypes, if not defined, type "" is being used
- **visibleIn3D** (Optional): [Boolean](../topics/Boolean.md) - true to make task always visible in 3D (default: false)

**Returns:** [String](../topics/String.md) - task ID

## Examples

### Example 1

```sqf
["Task_01", true, ["Protect the respawn point.","Respawn Point West","respawn_west"], [MHQ,false], "ASSIGNED", 5, true, true, "Defend", true] call BIS_fnc_setTask;
```

## See also

Arma 3: Task Framework

<sub>Source: [BI Community Wiki — BIS fnc setTask](https://community.bistudio.com/wiki/BIS_fnc_setTask) (revision 352179).</sub>
