# Kithgard brawl help

**URL:** <https://discourse.codecombat.com/t/kithgard-brawl-help/14075>\
**Category:** Uncategorized\
**Created:** [February 28, 2018, 8:57pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-help/14075 "2018-02-28T20:57:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninjaboss50](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@ninjaboss50](https://discourse.codecombat.com/u/ninjaboss50)\
**Post date:** [February 28, 2018, 8:57pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-help/14075/1 "2018-02-28T20:57:34Z")

</div>

my code  
while True:

```
enemy = hero.findNearestEnemy()
if(enemy):
    if hero.isReady("cleave"):
        hero.cleave(enemy)
    elif hero.canElectrocute(enemy):
            hero.electrocute(enemy)
    else:
        hero.attack(hero.findNearestEnemy()
item = hero.findNearestItem()
elif(item):
    hero.moveXY(item.pos.X, item.pos.Y)

```

it shows  
fix you code  
cannot read property ‘start’ of undefined

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [February 28, 2018, 10:25pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-help/14075/2 "2018-02-28T22:25:51Z")

</div>

Parenthesis should not be used around the variable enemy or item in the if or elif conditionals. Also, you have already defined enemy, therefore you shouldn’t be using its definition in your arguments for hero.attack. You used the correct argument in the cleave and electrocute statements. Do the same in attack argument.

---

<div class="post-metadata">

**Author:** ![Seojin\_Roy\_Lee](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/seojin_roy_lee/32/23539_2.png) [@Seojin\_Roy\_Lee](https://discourse.codecombat.com/u/Seojin_Roy_Lee)\
**Post date:** [March 1, 2018, 1:27am UTC](https://discourse.codecombat.com/t/kithgard-brawl-help/14075/3 "2018-03-01T01:27:30Z")

</div>

don’t define the item’s ‘x’ cordinate and ‘y’ cordinate in capitals
