ID:178631
 
how do I make it so it's an if statement with an "and" like:

if (usr.exp > 9) AND (usr.level=0)
usr.level += 1
usr << "You have gained a level!"
Look up && in the reference.
In response to Nadrew
I put it in and it still won't work right:


if (usr.exp > 9 && usr.level = 0)
usr.level += 1
usr << "You have gained a level!"
usr.HP +=5
usr.MAX_HP +=5
usr.strength +=1
In response to Likwiddraino000
Likwiddraino000 wrote:
I put it in and it still won't work right:


if (usr.exp > 9 && usr.level = 0)
usr.level += 1
usr << "You have gained a level!"
usr.HP +=5
usr.MAX_HP +=5
usr.strength +=1

In if statements you have to use boolean expressions. Look up boolean expressions.

In response to BurningIce
it doesn't say anything about em
In response to Likwiddraino000
Likwiddraino000 wrote:
I put it in and it still won't work right:


if (usr.exp > 9 && usr.level = 0)
usr.level += 1
usr << "You have gained a level!"
usr.HP +=5
usr.MAX_HP +=5
usr.strength +=1

if (usr.exp > 9 && usr.level == 0)

= means an assignment
== means a comparison
In response to Skysaw
if (src.exp > 9 && src.level == 0)
src.level += 1
src << "You have gained a level!"


-Kappa the Imp

In response to Kappa the Imp
Kappa the Imp wrote:
> if (src.exp > 9 && src.level == 0)
> src.level += 1
> src << "You have gained a level!"
>

-Kappa the Imp

Already answered in this thread, and already acknowledged.