Siege Of StoneHold

Hey everyone, I’m new here and to coding, I’m trying to figure out if something is wrong with my code.

    enemy = self.findNearestEnemy()
    flag = self.findFlag()
    if enemy:
        distance = self.distanceTo(enemy)
    if distance < 10:
        if self.isReady("cleave"):
    elif enemy:
    elif flag:

I’m not getting any errors, but after he cleaves, he’ll only attack once, and then just stands there until cleave is ready again. How can I make it so he will attack more than once?

My Syntax is correct also, but not sure how to get it to show here.

put on a line by itself both before and after your code paste … three of these characters `

Indentations, they will save your life!

Wait, I just had a Déjà vu.
I’m not gonna write it all again, but your problem is explained quite detailed (excuse the self-advertising) in the linked post.

Dont worry Deja-vu happens all the time.