[SOLVED] backwoods-standoff-a

Hi ,I got a problem with pass this level [impas w mateczniku A ] , my hero has a little energy to win!
Everything with code seems to be ok

|690x431](upload://i773NssRNXhYJsGtL1TdQyYQfjj.jpeg)

please help

Hi , can anyone look at it, and help me?
thx a lot :slight_smile:

Zambi, post a screenshot of your hero…showing what armor, weps, etc you have equipped. I see that you tried, but it appears that you saved the shot, then attempted to upload. Instead, if you don’t have Snip-it (comes with Windows), you can press the ‘print screen’ button, and then directly paste here, in this chat box.

hi I bought new armor and now everthing is ok
many thx to @dedreous

My equipment:
image
My code:

While(true) {
    var enemy = hero.findNearestEnemy();
    // Use an if-statement with isReady to check "cleave":
    if hero.isReady("cleave")
        // Cleave!
        hero.cleave(enemy);
    // Else, if cleave is not ready:
    else {
        hero.attack(enemy);
    }
}

Gives me this error:
image

You didn’t wrap this with brackets for the if-statement

1 Like
while(true) {
    var enemy = hero.findNearestEnemy();
    // Use an if-statement with isReady to check "cleave":
    if (hero.isReady("cleave"));
        // Cleave!
        hero.cleave(enemy);
    // Else, if cleave is not ready:
    else {
        hero.attack(enemy);
}

I now get this warning
image

You fixed one of the mistakes, but also, like you did for the else-statement, you should put the below in {}

else (hero.isReady("attack")); {
        hero.attack(enemy);
}

Like this?
This also gives me an error though:
image

nooo, you shouldn’t do that, you should put the cleave statement in those {}, and return the else-statement to the way it was

Hint

if  (hero.isReady("cleave") {
hero.cleave(enemy);
}
while(true) {
    var enemy = hero.findNearestEnemy();
   if (hero.isReady("cleave")) {
    hero.cleave(enemy);
}
}
    else {
        hero.attack(enemy);
}

image

You should remove the bottom bracket and place it under the attack statement

1 Like

All done! Thanks for your help! :+1:

1 Like

Anytime :slight_smile:
Just mark the post that helped you most as a solution, so that the topic will close

I didn’t make this topic, @Zambi25 did but didn’t close it
I used this topic to save me making another one. Sorry if it came across as necro

No, its fine :slight_smile:

Maybe @Deadpool198 can close it?