'var' is a virtual Lua table that can be used to access zScript variables. You can use it as either zs.var.varname or zs.var["varname"] just like normal Lua tables.
You can use this to retrieve a zScript variable, or to set it's value. For example, if you had a zScript variable named "hp", then you could do this:
print(zs.var.hp)
zs.var.hp = zs.var.hp + 10
print(zs.var.hp)
This will display the value of the @hp zScript variable, and then increment it by 10 and display the new value.
Add comment