# ! need help (backwood forest)! \[SOLVED\]

**URL:** <https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654>\
**Category:** Level Help\
**Created:** [May 1, 2021, 5:03pm UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654 "2021-05-01T17:03:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![XxX\_Mem0\_XxX](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/xxx_mem0_xxx/32/22397_2.png) [@XxX\_Mem0\_XxX](https://discourse.codecombat.com/u/XxX_Mem0_XxX)\
**Post date:** [May 1, 2021, 5:03pm UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/1 "2021-05-01T17:03:18Z")

</div>

On level Long-Range Division in Backwood Forest, my Code doesnt seem to Work.  
Thats why i need Help.  
This is my Code :

```python
var enemy = hero.findNearestEnemy();
var distanceToEnemy = hero.distanceTo(enemy);
hero.say(distanceToEnemy / 3);
hero.say("Fire!");

var distanceToEnemy2 = hero.distanceTo(enemy);
hero.say(distanceToEnemy / 1.5);
hero.say("Fire!");

hero.say("Woo hoo!");
hero.say("Here we go!");
hero.say("Charge!!");

while(true) {   
    hero.attack(enemy);
}

```

My last Goal is to kill BOTH of the enemys. But my Code only kills one of the Enemy.  
Can somebody help please ? 🤨

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 1, 2021, 5:17pm UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/3 "2021-05-01T17:17:11Z")

</div>

I only know python not JS, but in python we’re supposed to have the `hero.findNearestEnemy()` inside the while true loop. So would it help if you put everything but all the hero.say stuff inside a while true loop?

---

<div class="post-metadata">

**Author:** ![thebagel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thebagel/32/22241_2.png) [@thebagel](https://discourse.codecombat.com/u/thebagel)\
**Post date:** [May 1, 2021, 5:51pm UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/4 "2021-05-01T17:51:08Z")

</div>

> [@XxX\_Mem0\_XxX](#):
>
> ```python
> hero.say("Woo hoo!");
> hero.say("Here we go!");
> hero.say("Charge!!");
> 
> ```

I think you don’t need this part. This might be takign up time where you are perhaps dying? can you send a link?

---

<div class="post-metadata">

**Author:** ![XxX\_Mem0\_XxX](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/xxx_mem0_xxx/32/22397_2.png) [@XxX\_Mem0\_XxX](https://discourse.codecombat.com/u/XxX_Mem0_XxX)\
**Post date:** [May 2, 2021, 10:06am UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/5 "2021-05-02T10:06:47Z")

</div>

This was in the level i didnt extra code it in.

---

<div class="post-metadata">

**Author:** ![XxX\_Mem0\_XxX](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/xxx_mem0_xxx/32/22397_2.png) [@XxX\_Mem0\_XxX](https://discourse.codecombat.com/u/XxX_Mem0_XxX)\
**Post date:** [May 2, 2021, 10:13am UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/6 "2021-05-02T10:13:34Z")

</div>

Thank u @enPointe77, it worked. 😁

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 2, 2021, 2:44pm UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/7 "2021-05-02T14:44:19Z")

</div>

No problem, glad it helped!

---

<div class="post-metadata">

**Author:** ![cheddarcheese](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/cheddarcheese/32/22417_2.png) [@cheddarcheese](https://discourse.codecombat.com/u/cheddarcheese)\
**Post date:** [October 20, 2021, 2:06am UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/8 "2021-10-20T02:06:56Z")

</div>

dont forget to click the check box next to the comment that helped you most

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [October 20, 2021, 4:20am UTC](https://discourse.codecombat.com/t/need-help-backwood-forest-solved/28654/9 "2021-10-20T04:20:59Z")

</div>

He’s not even active anymore. This happened 6 months ago.
