A simple variable is simply declared using
variable = data;
This variable can be used in the current function and any function that passes it as an argument, or is called on it (so it'd be used as 'self').
Variables can be global (which can be used in all threads without needing to be called) by using the
level.variable = data;
or they can be assigned to entities individually
entity.variable = data;
for things like player.health (integer, already built-in, but can be modified) and level.teamBased (boolean).