---
name: "BIS_fnc_taskDefend"
type: function
status: ok
groups: ["Tasks"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_taskDefend
revid: 325114
updated: 2022-07-01T12:28:08Z
---

# BIS_fnc_taskDefend

*Function · Tasks · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Group will man nearby static defenses within a 100 metre radius of the defense position and guard the position. Some units will man weapons, others will patrol and the remainder will sit on the ground.

## Syntax

```sqf
[group, position] call BIS_fnc_taskDefend
```

**Parameters:**

- `group`: [Group](../topics/Group.md)
- `position`: [Array](../topics/Array.md) in format [Position](../topics/Position.md)

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

## Examples

### Example 1

```sqf
[group player, getPosATL leader player] call BIS_fnc_taskDefend;
```

## See also

Functions Library · [BIS_fnc_taskAttack](../functions/BIS_fnc_taskAttack.md) · [BIS_fnc_taskPatrol](../functions/BIS_fnc_taskPatrol.md)

## Community notes

**Preacher** — 2009-12-20

The easiest way to use this function is to create a group, then add the following code to the group leader's init field:

```sqf
[group this, getPosATL this] call BIS_fnc_taskDefend;
```

---

**McHide** — 2009-12-09

The **more correct way** is to:

1. Place function module on map (Arma 2 only)
1. Make one waypoint for group and put this code in Waypoints  On.Act. field

```sqf
[group this, getPosATL this] call BIS_fnc_taskDefend;
```

  - You can use triggers for this function too, but your groups must be named

```sqf
{ [_x, getPosATL leader _x] call BIS_fnc_taskDefend } forEach [grpName1, grpName2];
```

<sub>Source: [BI Community Wiki — BIS fnc taskDefend](https://community.bistudio.com/wiki/BIS_fnc_taskDefend) (revision 325114).</sub>
