Thanks. That got me a bit closer, but I’m still dying. I’ve selected all the items you said. Do i need to use some sort of shield function for the shield to actually work?
You could use hero.shield(), which is a command that makes you take less damage for a certain amount of time, but you cannot counter attack. There are very rare cases where shield can be used effectively.
The shield just gives you extra health in combat, that is all.
Can you send me a screen of your hero and gear you are using?
Thank you to everyone who helped. My code was right yesterday, I just needed to add the helmet and bronze shield.
Omg Thanks so much helped me so much ur great
Thanks very mouch! #solved
Still not sure why this does not work for me
Reason: Can’t attack with hero.attack(enemy)
No one can assist you if you don’t post your code.
I am having trouble betting this level also my char cleaves just fine but wont attack after the else statement
Hi, it’s because in the first if, you’re checking for an enemy. What happens if there’s always an enemy but you’re not ready to cleave? It won’t go to the else because there is an enemy.
Hi Sonic101light. Welcome to Discourse! There’s a couple of things that need to be done to get this code to work.
First, line 9,
ready = hero.isReady("cleave")
You’ve defined a variable,
ready, but then you never use it. But that’s okay because this line is supposed to check if the hero is able to cleave. We have to check to see if this is possible because cleave has a ten second cooldown period. It cannot be used during the cooldown so we check if it is “ready.”
Also, line 13 is an issue. You are already inside a
while True loop and you don’t need another one. If you look at line 12, it tells you that the next line should be an
else conditional. Lines 14 and 16 aren’t necessary because you’ve already defined enemy on line 6.
One more thing - while it is fun to make the hero say fun stuff (I do it sometimes as well), remember that any time you use
hero.say("say stuff"), it consumes a full second of time. It’s up to you to decide when you can do this and when you simply don’t have the time to do so.
It does not work when i do it, or the code
@Proskils7 please show us your code so we can see the problem. Also please be specific about your errors.