# Small problem please help

**URL:** <https://discourse.codecombat.com/t/small-problem-please-help/35330>\
**Category:** AILeague\
**Created:** [April 10, 2023, 8:34pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330 "2023-04-10T20:34:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 10, 2023, 8:34pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/1 "2023-04-10T20:34:30Z")

</div>

```python
def guardcastle ():
    while True:
        if enemy.properties(health) > 1000:
            hero.build("archer", "a")

```

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 10, 2023, 8:36pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/2 "2023-04-10T20:36:08Z")

</div>

it says cannot read the properties of null help @Bryukh

---

<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:** [April 11, 2023, 6:46am UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/3 "2023-04-11T06:46:27Z")

</div>

Hi, sadly, my telepathic powers are disabled temporarily ☹  
Could you explain what’s the problem? Where is the problem? And what are we talking about?

---

<div class="post-metadata">

**Author:** ![Chaboi\_3000](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chaboi_3000/32/48486_2.png) [@Chaboi\_3000](https://discourse.codecombat.com/u/Chaboi_3000)\
**Post date:** [April 11, 2023, 8:05am UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/4 "2023-04-11T08:05:36Z")

</div>

If you are trying to get the health property/value of the enemy, you would use `enemy.health`, rather than `enemy.properties(health)`

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 11, 2023, 3:26pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/5 "2023-04-11T15:26:33Z")

</div>

tried that but it only works for all enemies and not for nearest enemy and even forr all enemies the if even though though it should = true @Chaboi_3000

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 11, 2023, 3:36pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/6 "2023-04-11T15:36:14Z")

</div>

and what are the monster types . @Chaboi_3000

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 11, 2023, 4:02pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/7 "2023-04-11T16:02:37Z")

</div>

i did some trouble shoothing and i think that hero find nearest enemy is the prob

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [April 11, 2023, 4:25pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/8 "2023-04-11T16:25:16Z")

</div>

dont @ people multiple times how annoying would it be if i did this  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/6/f6abdc75a6bffebe37e65c1bfec51654d7a522ad.png)

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 11, 2023, 4:43pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/9 "2023-04-11T16:43:42Z")

</div>

ok 👌 thanks for the information

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 12, 2023, 7:31pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/10 "2023-04-12T19:31:16Z")

</div>

```
    en = champion.findNearestEnemy()
    if en:
        champion = data.champion;
        guide=champion.findNearestEnemy()
        if guide.x < champion.x:
            if champion.place==h or g:
                champion.moveTo("f or e")

```

what do you think is wrong never moves an inch @Bryukh @Chaboi_3000

---

<div class="post-metadata">

**Author:** ![Abel2021](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/abel2021/32/28887_2.png) [@Abel2021](https://discourse.codecombat.com/u/Abel2021)\
**Post date:** [April 12, 2023, 7:35pm UTC](https://discourse.codecombat.com/t/small-problem-please-help/35330/11 "2023-04-12T19:35:22Z")

</div>

nvm i relized hero. find nearest
