---
name: "assignTeam"
type: command
status: ok
groups: ["Groups"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/assignTeam
revid: 340282
updated: 2023-04-28T17:04:36Z
---

# assignTeam

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

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

## Description

| Team | Value |
|---|---|
| White | "MAIN" |
| Red | "RED" |
| Green | "GREEN" |
| Blue | "BLUE" |
| Yellow | "YELLOW" |

Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams.
In order to operate properly, the command requires specific conditions:
- the command requires [player](../commands/player.md) to be fully initialised
- the unit getting assigned must be either player himself or a unit in player's group
The colour of the assigned team for a unit is seen on the group management UI as well as squad radar.

> [!IMPORTANT]
> In older versions of the game (Arma 2?) the effect of this command is **local** Local Effect.

## Syntax

```sqf
unit assignTeam team
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `team`: [String](../topics/String.md)

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

## Examples

### Example 1

```sqf
_soldier2 assignTeam "RED";
```

### Example 2

In a unit's init script in the editor [spawn](../commands/spawn.md) should be used, otherwise a [race condition](https://en.wikipedia.org/wiki/Race_condition) may be experienced:

```sqf
this spawn { _this assignTeam "RED" };
```

## See also

[assignedTeam](../commands/assignedTeam.md) · [dissolveTeam](../commands/dissolveTeam.md) · [unassignTeam](../commands/unassignTeam.md)

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