---
name: "BIS_fnc_counter"
type: function
status: ok
groups: ["Systems"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_counter
revid: 363648
updated: 2024-04-11T15:43:06Z
---

# BIS_fnc_counter

*Function · Systems · Arma 3 v0.50 · introduced in Take On Helicopters v1.00*

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

## Description

Modify the given counter, create it if does not exist.

> [!IMPORTANT]
> It is **not** possible to broadcast the counter (like [setVariable](../commands/setVariable.md) does) with this function.

## Syntax

```sqf
[varName, add, modulo] call BIS_fnc_counter
```

**Parameters:**

- `varName`: [String](../topics/String.md) or [Array](../topics/Array.md) format [varName, namespace] - default namespace is [missionNamespace](../commands/missionNamespace.md)
- `add`: [Number](../topics/Number.md) - (Optional, default 0) the value to be added
- `modulo`: [Number](../topics/Number.md) - (Optional, default -1) the [mod](../commands/mod.md)ulo to use for counter cycle, applied after the addition

**Returns:** [Number](../topics/Number.md) the new counter value

## Examples

### Example 1

```sqf
[["TAG_Score", player], 1] call BIS_fnc_counter;
```

## See also

[BIS_fnc_deleteCounter](../functions/BIS_fnc_deleteCounter.md)

<sub>Source: [BI Community Wiki — BIS fnc counter](https://community.bistudio.com/wiki/BIS_fnc_counter) (revision 363648).</sub>
