ID:270085
 
I was wondering how would you come about adding two vars togther e.g.
usr.Hp + usr.MP

can anyone post how to do it please.
Thanks
usr.HP += usr.MP

//or...

usr.both = usr.HP + usr.MP



--Vito
In response to Vito Stolidus
thanks.
In response to Fire Dynasty
Similarly, you can use -=, *=, and /=. To add or subtract 1, you can do:
var/x = 1

x++ // uses, then increments/decrements
x--
++x // increments/decrements, then uses
--x
<dm>

--Vito
In response to Vito Stolidus
Yes, anytime you are adding/subtracting/mutiplying/dividing, and the number you doing it with doesn't equal a variable, like what ^^^^ posted, it must be either

+= adding
-= subtracting
*= multiplying
/= dividing


You cannot do just...
usr.Hp + usr.Mp//this will get you errors unless it it has something it equals
usr.special = usr.Mp + usr Hp
//other wise, it must be...
usr.Hp += usr.Mp


Just remember that and you'll be fine. I'm just further explaining what ^^^^ said. (sorry, I missed your name)