Hello, Zachary, and welcome. Please read the FAQ before you post again, so that you learn how to format your code properly. I’ve done it for you this time, but do so yourself in the future.
Phrases like “I need help!” or “This code doesn’t work!” don’t give us what problem you’re having. For future reference, next time give us more description of your error. However, here is what I can see off the top of my head:
Your indentations are a little mixed up. You need to indent lines 3 and 4 one level forward, and put the
else on the same level as the
if. Secondly, you only define
"cleave" is ready. Therefore, when
"cleave" is not ready,
enemy is undefined, but you try to attack it. Move the definition of
enemy out of the if-statement into the main loop. That should fix your problem.