Skip to content

Count

Count variables let a command store and update a named whole number. Use them for deaths, wins, attempts, rounds or anything else you want to track.

  1. Go to Commands and create or edit a command.
  2. Choose a short counter name, such as deaths.
  3. Add a count variable to the command response.

For a !death command, use this response:

Deaths: {count.inc deaths}

The first use creates the counter and changes it from 0 to 1. The response contains the new value.

Counter names identify separate values. {count.inc deaths} and {count deaths} use the same counter, while {count.inc wins} uses a different one. Use lowercase names without spaces to keep them easy to reuse.

VariableUseExample output
{count <counter_name>}Shows the current value for a counter.6
{count.inc <counter_name> [-/+amount]}Changes the counter by the amount. Defaults to 1; use a negative amount to decrease it.7
{count.set <counter_name> [amount]}Sets the counter to an exact value. Use 0 to reset it.4

A missing counter reads as 0. Incrementing it creates it automatically.

For {count.set deaths}, the amount can also come from the first command argument. For example, !setdeaths 12 sets the counter to 12. Restrict commands that change or reset counters to trusted users.

Counters are stored in channel KV as counter:<counter_name>. The deaths counter uses counter:deaths.

Select that key in a Value widget to display it in OBS. The widget updates as soon as a command changes the counter. The Death Counter preset selects counter:deaths automatically.