# THE SKELETON bug or user error?

**URL:** https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701
**Category:** Adventurer
**Created:** [August 19, 2016, 4:45am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701 "2016-08-19T04:45:01Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Kujo](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@Kujo](https://discourse.codecombat.com/u/Kujo)
#### Post date: [August 19, 2016, 4:45am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/1 "2016-08-19T04:45:01Z")

</div>

I am unsure if this was intentional or if I am just writing the code wrong for this level but when using the “While(true)” statement, defining the variable and setting the hero.attack, the hero does not survive. Unsure if it is required to buy higher equipment with gems but if that is not the case I was hoping for some pointers as to what I am doing wrong.

Code:  
while(true) {  
var enemy = hero.findNearestEnemy();  
hero.attack(enemy);  
}

---

<div class="post-metadata">

### Author: ![Bryukh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bryukh/32/19597_2.png) [@Bryukh](https://discourse.codecombat.com/u/Bryukh)
#### Post date: [August 19, 2016, 5:42am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/2 "2016-08-19T05:42:22Z")

</div>

> [@Kujo](#):
>
> for this level

Which one? Could you give more information? It’s hard to help you, when we need to guess about your problem.

---

<div class="post-metadata">

### Author: ![UltCombo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ultcombo/32/3822_2.png) [@UltCombo](https://discourse.codecombat.com/u/UltCombo)
#### Post date: [August 19, 2016, 5:43am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/3 "2016-08-19T05:43:32Z")

</div>

@Bryukh I believe the level is [The Skeleton](https://codecombat.com/play/level/the-skeleton).

---

<div class="post-metadata">

### Author: ![Bryukh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bryukh/32/19597_2.png) [@Bryukh](https://discourse.codecombat.com/u/Bryukh)
#### Post date: [August 19, 2016, 5:44am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/4 "2016-08-19T05:44:05Z")

</div>

Oh, I though it was “skeleton bug” 🙂

---

<div class="post-metadata">

### Author: ![Bryukh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bryukh/32/19597_2.png) [@Bryukh](https://discourse.codecombat.com/u/Bryukh)
#### Post date: [August 19, 2016, 5:47am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/5 "2016-08-19T05:47:30Z")

</div>

Which equipment are you using? Could you give a screenshot?

---

<div class="post-metadata">

### Author: ![Gabbek](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/gabbek/32/4419_2.png) [@Gabbek](https://discourse.codecombat.com/u/Gabbek)
#### Post date: [August 19, 2016, 12:05pm UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/6 "2016-08-19T12:05:53Z")

</div>

I was able to complete this level with 134 health and long sword, no rings or anything else. Could you please provide a bit more information so we can help you out?

---

<div class="post-metadata">

### Author: ![Kujo](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@Kujo](https://discourse.codecombat.com/u/Kujo)
#### Post date: [August 20, 2016, 7:00am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/7 "2016-08-20T07:00:25Z")

</div>

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/codecombat/original/2X/f/fdebc2e6a21c1c5c0bb78d91f3411966229d484a.png)

---

<div class="post-metadata">

### Author: ![Bryukh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bryukh/32/19597_2.png) [@Bryukh](https://discourse.codecombat.com/u/Bryukh)
#### Post date: [August 20, 2016, 11:22am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/8 "2016-08-20T11:22:20Z")

</div>

Yeah, “Plain sword” is not enough to pass this level.

---

<div class="post-metadata">

### Author: ![Gabbek](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/gabbek/32/4419_2.png) [@Gabbek](https://discourse.codecombat.com/u/Gabbek)
#### Post date: [August 20, 2016, 11:39am UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/9 "2016-08-20T11:39:20Z")

</div>

If I remember correctly you’ll get more advanced sword, with cleave as soon as you reach forest levels - or you’ll have to do few of them, with long sword you’ll definitely be able to do it - so come back to this level slighty later 🙂

---

<div class="post-metadata">

### Author: ![Kujo](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@Kujo](https://discourse.codecombat.com/u/Kujo)
#### Post date: [August 20, 2016, 6:36pm UTC](https://discourse.codecombat.com/t/the-skeleton-bug-or-user-error/8701/10 "2016-08-20T18:36:45Z")

</div>

Okay, thanks guys. I bought a better sword to complete it but since I hadn’t gotten one by default I thought there would be a way to beat it without getting a new one.
