Sos on leave it on cleaver! any help?

I’ve tried this:
def cleaveWhenClose(target):
if hero.distanceTo(target) < 5:
pass
# Put your attack code here
# If cleave is ready, then cleave target
hero.cleave(enemy)
# else, just attack target!
else:
hero.attack(enemy)
hero.attack(enemy)

This code is not part of the function.

while True:
enemy = hero.findNearestEnemy()
if enemy:
# Note that inside cleaveWhenClose, we refer to the enemy as target.
cleaveWhenClose(enemy)
cleaveWhenClose(enemy)
[Please be polite]

Please post your code according to the FAQ.

If cleave is ready, then cleave target =>
if hero.isReady(“cleave”):

3 Likes

Make sure cleave isReady before you cleave. if(hero.isReady(“cleave”). Also, please do not use profanity

1 Like