[HELP] CS2 leave it to cleaver level 32

Hello, welcome to the CodeCombat forum. To help you out the best, it is important to post your code correctly so we can see all the possible issues. Since you are writing in Python, indentation is critical; but we can’t see if that is causing any of your problems when the code in improperly formatted.

You can use the if statement with other code to see if the hero is ready to use an attack (command). The if statement needs a boolean (True or False) answer. The code hero.isReady("cleave") checks to see if the hero is ready and returns True or False which means you can pair it right in an if statement.

if hero.isReady("cleave"): # if cleave is ready it returns True
    hero.cleave(target)
else:  # if not ready to cleave (False above) do this instead
    hero.attack(target)

The post below will walk you through posting your code correctly.

1 Like