my guy won’t move at all please help
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 == 10:
hero.attack(hero.findNearestEnemy())
Delete this then you should be good
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)
and also just put enemy here for this
it is saying the line that line 14 has a problem and that is my if statement
What language are you using
You have a mix of python and javascript, you need to choose one
Lydia
And your indentation is wrong here:
Lydia
ok so get rid of all that
Yup then give us your new code.
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)
What happens now(20 char)
Put this :
at the end of the line
ummm that is already there?