# I really need help with the level "Operation: Killdeer"\[SOLVED\]

**URL:** <https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501>\
**Category:** Level Help\
**Created:** [February 18, 2021, 7:55pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501 "2021-02-18T19:55:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FireDragonYesh592](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/firedragonyesh592/32/20722_2.png) [@FireDragonYesh592](https://discourse.codecombat.com/u/FireDragonYesh592)\
**Post date:** [February 18, 2021, 7:55pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/1 "2021-02-18T19:55:30Z")

</div>

It is confusing and difficult. Please help.

---

<div class="post-metadata">

**Author:** ![milton.jinich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milton.jinich/32/21419_2.png) [@milton.jinich](https://discourse.codecombat.com/u/milton.jinich)\
**Post date:** [February 18, 2021, 7:56pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/2 "2021-02-18T19:56:21Z")

</div>

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review [this topic](https://discourse.codecombat.com/t/welcome-to-codecombat-discourse-forums/15601), which shows all essentials of this board! Thanks!

---

<div class="post-metadata">

**Author:** ![milton.jinich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milton.jinich/32/21419_2.png) [@milton.jinich](https://discourse.codecombat.com/u/milton.jinich)\
**Post date:** [February 18, 2021, 7:56pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/3 "2021-02-18T19:56:43Z")

</div>

Please post your code so we can help you.

---

<div class="post-metadata">

**Author:** ![FireDragonYesh592](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/firedragonyesh592/32/20722_2.png) [@FireDragonYesh592](https://discourse.codecombat.com/u/FireDragonYesh592)\
**Post date:** [February 18, 2021, 8:02pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/4 "2021-02-18T20:02:38Z")

</div>

here is my code:

````python
type or paste code here
```# Lure the ogres into a trap. These ogres are careful.
# They will only follow if the hero is injured.
enemy = hero.findNearestEnemy()
# This function checks the hero's health 
# and returns a Boolean value.
def shouldRun():
    if hero.health < hero.maxHealth / 2:
        return True
    else:
        return False

while True:
    # Move to the X only if shouldRun() returns True
    if shouldRun = true:
    x = hero.pos.x + 10
    hero.moveXY(x, 37)
    hero.moveXY(75, 37)
    # Else, attack!
    hero.attack(enemy)
````

---

<div class="post-metadata">

**Author:** ![FireDragonYesh592](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/firedragonyesh592/32/20722_2.png) [@FireDragonYesh592](https://discourse.codecombat.com/u/FireDragonYesh592)\
**Post date:** [February 18, 2021, 8:21pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/5 "2021-02-18T20:21:31Z")

</div>

This level is in the Sarven Desert

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [February 18, 2021, 8:22pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/6 "2021-02-18T20:22:52Z")

</div>

> [@FireDragonYesh592](#):
>
> ```python
> if shouldRun = true:
> x = hero.pos.x + 10
> hero.moveXY(x, 37)
> hero.moveXY(75, 37)
> # Else, attack!
> hero.attack(enemy)
> 
> ```

Change that to

```python
    # Move to the X only if shouldRun() returns True
    if shouldRun():
        hero.moveXY(75, 37)
    # Else, attack!
    else:
        enemy = hero.findNearestEnemy()
        hero.attack(enemy)

```

---

<div class="post-metadata">

**Author:** ![FireDragonYesh592](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/firedragonyesh592/32/20722_2.png) [@FireDragonYesh592](https://discourse.codecombat.com/u/FireDragonYesh592)\
**Post date:** [February 18, 2021, 8:27pm UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/7 "2021-02-18T20:27:56Z")

</div>

It worked! Thank you so much Eric\_Tang. Your the best.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [February 19, 2021, 8:28am UTC](https://discourse.codecombat.com/t/i-really-need-help-with-the-level-operation-killdeer-solved/27501/8 "2021-02-19T08:28:05Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
