This shows how to define a function called cleaveWhenClose
The function defines a parameter called target
if hero.distanceTo(target) < 5:
# Put your attack code here
# If cleave is ready, then cleave target
# else, just attack target!
This code is not part of the function.
enemy = hero.findNearestEnemy()
# Note that inside cleaveWhenClose, we refer to the enemy as target.
This my code for leave it to the cleaver and it doesn’t work. The last two ogres aren’t getting attack. My family has tried it my brother and dad they both failed