Backwoods standoff help


#1

I am having trouble with backwoods standoff
I am using lua. This is the code I tried

while true do
    local enemy = hero:findNearestEnemy()

    if hero:isReady("cleave")
        -
        then hero:cleave(enemy)
        
   else hero:attack(enemy)
end
end

#2

Did you check if “enemy” was valid?

Use if enemy before attacking or cleaving