---
name: "createGroup"
type: command
status: ok
groups: ["Groups"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/createGroup
revid: 364085
updated: 2024-05-03T19:33:29Z
---

# createGroup

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

Locality: effect **global**

## Description

Creates a new [Group](../topics/Group.md) for the given [Side](../topics/Side.md). Using this command if the group limit is reached will return [grpNull](../commands/grpNull.md). The new [Group](../topics/Group.md) exists globally, but it's locality is where this command was executed.

|  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|
| Game | Operation Flashpoint v1.00 | Operation Flashpoint: Elite v1.00 | Armed Assault v1.00 | Arma 2 v1.00 | Arma 2: Operation Arrowhead v1.50 | Take On Helicopters v1.00 | Arma 3 v1.00 | Arma 3 v1.68 |
| Group auto-deletion | ✗ | ✓ |  |  |  |  |  |  |
| Group limit per side | 63 | 144 | 288 |  |  |  |  |  |

> [!IMPORTANT]
> - Groups can only be created for the [west](../commands/west.md)/[blufor](../commands/blufor.md), [opfor](../commands/opfor.md)/[east](../commands/east.md), [independent](../commands/independent.md)/[resistance](../commands/resistance.md), [civilian](../commands/civilian.md) and [sideLogic](../commands/sideLogic.md) sides - any other side will return [grpNull](../commands/grpNull.md)
> - Before Arma 3, a [Side](../topics/Side.md) [center](../commands/createCenter.md) must exist before group creation (either by having editor-placed units or [createCenter](../commands/createCenter.md) usage)

> [!NOTE]
> **Arma 3:** - [createCenter](../commands/createCenter.md) usage is not needed anymore as all centers are automatically created.
> - When the last unit leaves its group, the group usually gets immediately auto-deleted, regardless of its auto-deletion setting.

## Syntax

### Syntax 1

```sqf
createGroup side
```

**Parameters:**

- `side`: [Side](../topics/Side.md)

**Returns:** [Group](../topics/Group.md) - [grpNull](../commands/grpNull.md) if the group limit is reached

### Syntax 2

*since arma3 1.68*

```sqf
createGroup [side, deleteWhenEmpty]
```

**Parameters:**

- `side`: [Side](../topics/Side.md)
- `deleteWhenEmpty`: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to [delete the group when empty](../commands/deleteGroupWhenEmpty.md).
  - If set to [true](../commands/true.md), forces a group to get deleted when empty - it does **not** prevent its deletion by other commands when set to [false](../commands/false.md).
  - Deletion may take up to a minute after the last unit is removed.

**Returns:** [Group](../topics/Group.md) - [grpNull](../commands/grpNull.md) if the group limit is reached

## Examples

### Example 1

```sqf
private _group = createGroup east;
```

### Example 2

```sqf
private _group = createGroup [east, true];
```

## See also

[deleteGroup](../commands/deleteGroup.md) · [deleteGroupWhenEmpty](../commands/deleteGroupWhenEmpty.md) · [isGroupDeletedWhenEmpty](../commands/isGroupDeletedWhenEmpty.md) · [group](../commands/group.md) · [setGroupId](../commands/setGroupId.md) · groupID · [units](../commands/units.md) · [groupFromNetId](../commands/groupFromNetId.md) · [netId](../commands/netId.md) · [leader](../commands/leader.md) · [selectLeader](../commands/selectLeader.md) · [join](../commands/join.md) · [createCenter](../commands/createCenter.md) · [createUnit](../commands/createUnit.md) · [createVehicle](../commands/createVehicle.md) · [Side](../topics/Side.md)

## Community notes

**.kju** — 2011-01-04

A group created with [createGroup](../commands/createGroup.md) will get a waypoint at [0,0,0]. When you use [createUnit](../commands/createUnit.md) to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as [currentWaypoint](../commands/currentWaypoint.md). However keep these two waypoints in mind when you do some scripting involving this groups' waypoints.

---

**DreadedEntity** — 2022-05-04

New group is local to the machine that executed the command (**A3 2.08.149102**):

```sqf
player addAction ["Group Test (Dedicated Server)", {
    [[], {
        _test = createGroup [west, true];
        [str (local _test)] remoteExec ["hint", -2]; //tell all clients group locality; true
        missionNamespace setVariable ["Group_Reference", _test, true]; //broadcast group reference to all players
    }] remoteExec ["call", 2]; //create group on dedicated server only
    sleep 1;
    _newGroup = missionNamespace getVariable "Group_Reference"; //receive group reference from server
    systemChat format ["Group local to player: %1", local _newGroup]; //false
}];
```

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