---
name: "BIS_fnc_unpackStaticWeapon"
type: function
status: ok
groups: ["Weapons"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_unpackStaticWeapon
revid: 352038
updated: 2024-02-01T23:24:28Z
---

# BIS_fnc_unpackStaticWeapon

*Function · Weapons · Arma 3 v1.00*

## Description

This function will move given support team to the given weapon position.
The weapon crew will unpack carried weapon and start watching given target position.
Requires three personnel in the team: Team Leader, Gunner and Asst. Gunner.
This function is MP compatible.

When the weapon is unpacked, the ["StaticWeaponUnpacked"](../topics/Scripted_Event_Handlers.md#events) scripted EH is called.

> [!NOTE]
> If a unit flees, all bets are off and the function will exit leaving units on their own.
> To guarantee weapon disassembly, make sure the group has maximum courage: `_group allowFleeing 0;`.

## Syntax

```sqf
[group, weaponPos, targetPos, leaderPos] call BIS_fnc_unpackStaticWeapon
```

**Parameters:**

- `group`: [Group](../topics/Group.md) or [Object](../topics/Object.md) - the support team group or a unit from this group
- `weaponPos`: [Array](../topics/Array.md), [String](../topics/String.md) or [Object](../topics/Object.md) - weapon placement position, object position or marker
- `targetPos`: [Array](../topics/Array.md), [String](../topics/String.md) or [Object](../topics/Object.md) - target position, object position to watch or marker
- `leaderPos`:  [Array](../topics/Array.md), [String](../topics/String.md) or [Object](../topics/Object.md) - (Optional) position, object or marker group leader should move to

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

## Examples

### Example 1

```sqf
[leader1, "weapon_mrk", "target_mrk"] call BIS_fnc_unpackStaticWeapon;
```

### Example 2

```sqf
group1 allowFleeing 0;
[group1, "weapon_mrk", tank1, "leader_mrk"] call BIS_fnc_unpackStaticWeapon;
```

## See also

[BIS_fnc_packStaticWeapon](../functions/BIS_fnc_packStaticWeapon.md) · [BIS_fnc_addScriptedEventHandler](../functions/BIS_fnc_addScriptedEventHandler.md)

## Community notes

**Killzone_Kid** — 2017-01-06

The following script will create a group consisting of a Team Leader, Gunner and Asst. Gunner and give the group 2 random MOVE waypoints. After the group reached the 1st waypoint, waypoint statement will execute [BIS_fnc_unpackStaticWeapon](../functions/BIS_fnc_unpackStaticWeapon.md) and the group will stop and unpack static weapon, while leader is given random position to go to. After 7 seconds the [BIS_fnc_packStaticWeapon](../functions/BIS_fnc_packStaticWeapon.md) is executed and the group packs and heads to 2nd waypoint.

```sqf
private _group = createGroup west;
private _pos = player getRelPos [20, 0];
private _randomDir = random 360;
private _wp1 = _group addWaypoint [_pos getPos [20, _randomDir], 10];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointStatements ["true", "
    group this allowFleeing 0;
    [group this, 'StaticWeaponUnpacked', {
        _this spawn
        {
            sleep 7;
            [_this select 0] call BIS_fnc_packStaticWeapon;
        };
    }] call BIS_fnc_addScriptedEventHandler;
    [
        this, 
        this, 
        this getPos [1000, random 360], 
        this getPos [10, 0]
    ] call BIS_fnc_unpackStaticWeapon;
"];
private _wp2 = _group addWaypoint [_pos getPos [20, _randomDir - 180], 10];
_wp2 setWaypointType "MOVE";
private _leader = _group createUnit ["B_Soldier_TL_F", _pos, [], 0, "NONE"];
private _gunner = _group createUnit ["B_Support_GMG_F", _pos, [], 0, "NONE"];
private _assistant = _group createUnit ["B_Support_AMG_F", _pos, [], 0, "NONE"];
units _group doFollow _leader;
```

<sub>Source: [BI Community Wiki — BIS fnc unpackStaticWeapon](https://community.bistudio.com/wiki/BIS_fnc_unpackStaticWeapon) (revision 352038).</sub>
