Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Backwoods standoff help


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)


Did you check if “enemy” was valid?

Use if enemy before attacking or cleaving