If you're not familiar with c code but you may very well be--when you declare a variable--you have to set it to a type that indicates whether it's going to be an integer (numbers that aren't decimals), character, string (of characters) or float which is for numbers that involve decimals.
Could be:
int x
char c
string munch
float x
but look down below:
So in GE when you want to add a new variable, you can hit script up top, and click on any script that's shown and choose variables down at the bottom--then you get a chance to add a new one.
asks you to give it a name.
Easy. Here it's health.
Then in a dropdown menu,it asks you whether that variable is going to be an
integer
real
or
string
now I don't have a clue what a real is but am going to search it here : )
a string is usually characters and an integer numbers
I hope I'm not being too basic -- forgive me if I am
before you can use a variable in script you have to create it like that
then, once you create it
use the scripts just as above where and how Bee-Ant has told you to put the script that uses your newly declared variable and DST has commented on it.
if you're still not sure, come back
Again, I'm sorry if I'm being too simple but am not sure exactly where you're stuck.
AHA! A "real" variable is a subset of what I know to be a "float". That is when you want your variable to be expressed as a decimal.
So if you want your variable to be expressed as a decimal use ---choose "real" in the dropdown menu.
Use "integer" in dropdown menu for variable when you don't want your number to be expressed as a decimal.
Thanks to your question, have added new knowledge to my little array. : )