Variables can be used to store numbers and strings, and later work with them. As their name suggests, they can be changed anytime, even during a Lua script. First, they have to be defined at the very start of the code. Defining them is easy: spawned=0 A variable named "spawned" has been created, and its value is currently 0. The variable later can be increased - for example, by 1 - by making them equal with themselves + 1, something like this: spawned=spawned+1 spawned=0 addhook("spawn","counter") function counter(id) spawned=spawned+1 end spawned[id]=0 --Where "id" is the player's ID.
| Graph IRI | Count |
|---|---|
| http://dbkwik.webdatacommons.org | 7 |