Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

How-To-Use "Punch"

How do I use the punch Function?

when i use hero.punch(hero.findNearestEnemy());

my Hero doesnt do anything.
What can I do?

thanks.

Try to do:

if hero.isReady("punch"):
   hero.punch(hero.findNearestEnemy())

Or

enemy = hero.findNearestEnemy()
if enemy:
   if hero.isReady("punch"):
      hero.punch(enemy)
4 Likes

@PeterPalov thank you.

2 Likes