Hero.distance type error [Solved]

    if enemy and enemy.type != "sand-yak" and enemy.distance <5 and hero.isReady("punch"):
# this is the part that has the type error :
enemy.distance

image

i wood give my whole code but this is a replayable level

yes, enemy.distance cannot exist by itself.So what is your problem?

wdym?
uh 20000000 chars

enemy.distance isn’t a real thing.
It’s hero.distanceTo(enemy)

oh i was confused because it didn’t say type error yesterday thx