[Solved]What does the duck mean?

my code:

# You'll need good strategy to win this one!
# Your clone will have the same equipment you have!
# But, they're not very skilled at using special powers.
while True:
    enemy = hero.findNearestEnemy()
    if enemy.distance < 10:
    if hero.health < hero.maxHealth/2:

this is where the error is:

  if enemy.distance < 10:

thanks moon!

Well, firstly try rewriting this line of code,

what line?

I gtg to sleep.Bye!sorry

its ok we all have to sleep.

Uhhhh, it’s supposed to be hero.distanceTo(enemy)… I think you should have already learned this in the forest.

1 Like

And the argument needs to be a position, so like:

{x: 36, y: 53};


{"x": 36, "y": 53}

oh ok i’ll try that
i haven’t played in a while so i forgot

or if you have vectors.


Bruh, he isn’t even in the Mountains yet, how would he know about vectors???

idk but u can do,
while loops, for loops and if/else and while True loops with no programiticon

True, but you wouldn’t be able to see how if you didn’t remember.

don’t get off topic.

Well technically it’s not off-topic, but thats good idea.

The problem is that you haven’t checked if the enemy exists.

And what moonwatcher said.

i did here

you still need to do enemy && hero.distanceTo(enemy) or enemy and hero.distanceTo(enemy) to check if the enemy exists or it will throw an error.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.