Help: Medical Attention

No it’s not put it there please

like this ?



while True:
    enemy = hero.findNearestEnemy()
    currentHealth = hero.health
    healingThreshold = hero.maxHealth / 2;
    
    
    
    if  currentHealth < healingThreshold
        
    hero.moveXY(65, 46):
        hero.say("heal me")
    if enemy:
        hero.attack(enemy)
    
    

Put this little thing : at the end of this sentence which should give you.

which should give you.

`if  currentHealth < healingThreshold:

if thats not it then i am confuzed

oh ok i will add that

umm now it is doing this

why is this so annoying!!!

1 Like

should i try using a different hero?

1 Like

just copy this line

if  currentHealth < healingThreshold:

and replace this with the line I gave you it is not about the hero.

1 Like

Delete this line

and copy and paste this line

if  currentHealth < healingThreshold:
1 Like

done



while True:
    enemy = hero.findNearestEnemy()
    currentHealth = hero.health
    if  currentHealth < healingThreshold:
    
    
    
    if  currentHealth < healingThreshold:
        
    hero.moveXY(65, 46):
        hero.say("heal me")
       
    if enemy:
        hero.attack(enemy)
    
1 Like

why wont he move!!!

1 Like

you indentation for this line(press “Tab”) is wrong and get rid of this : for that line.

1 Like

what do i put in the other

if currentHealth < healingThreshold:

statement?

1 Like

it is saying “empty if statement put 4 spaces”

1 Like

get rid of the top one of these

For this line

Get rid of this “:” and press the space bar until there is a light blue line behind it

1 Like

by the way thankyou man i would have never ever been able to do this without u(i didnt finish it yet)

1 Like

Did you not submit your code?

1 Like

Delete this

and this

Indent this
Lydia

1 Like

it stil lnot working he nor moving!!!

1 Like


while True:
    enemy = hero.findNearestEnemy()
    currentHealth = hero.health
    
    
    
    
    if currentHealth < healingThreshold:
        
        hero.moveXY(65, 46)
    hero.say("heal me")
       
    if enemy:
        hero.attack(enemy)
    

1 Like