Ok. I got it working. How would you display a variable in a chat message?
Like this?
messageClient(%client,'',"You ate a pie. You have eaten %client.piesEaten pies.");
Also, how would you add 1 onto a varible?
Like this?
%client.piesEaten + 1;
Or like this? (is this for checking what it is when you add 1?)
%client.piesEaten += 1;
To add a variable you can do
%client.piesEaten++; (this one is only to increment it by one),
%client.piesEaten += 1; or
%client.piesEaten = %client.piesEaten + 1;To subtract a variable you can do
%client.piesEaten--; (this one is only to decrement it by one),
%client.piesEaten -= 1; or
%client.piesEaten = %client.piesEaten - 1;To display a variable in a message do this:
messageClient(%client,'',"You ate a pie. You have eaten" SPC %client.piesEaten SPC "pies.");SPC is a connector that adds space in the part of the message were it connects. Other connectors are @, which connects it with no space or anything, and NL, which connects it and adds a new line at the spot were it connects.
In the below examples, %client.piesEaten is 2.
So,
messageClient(%client,'',"You ate a pie. You have eaten" SPC %client.piesEaten SPC "pies."); would look like: You ate a pie. You have eaten 2 pies.
messageClient(%client,'',"You ate a pie. You have eaten" @ %client.piesEaten @"pies."); would look like: You ate a pie. You have eaten2pies.
And
messageClient(%client,'',"You ate a pie. You have eaten" NL %client.piesEaten NL "pies."); would look like: You have eaten a pie. You have eaten
2
pies.
You need a connector at both ends of the variable, but the connectors can be different from each other.