# Hit and freeze help please

**URL:** <https://discourse.codecombat.com/t/hit-and-freeze-help-please/22840>\
**Category:** Level Help\
**Created:** [July 7, 2020, 1:50pm UTC](https://discourse.codecombat.com/t/hit-and-freeze-help-please/22840 "2020-07-07T13:50:09Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [July 17, 2020, 9:45am UTC](https://discourse.codecombat.com/t/hit-and-freeze-help-please/22840/21 "2020-07-17T09:45:24Z")

</div>

> [@Amber](#):
>
> `enemy = canAttack`

You already have the enemy found, don’t you think?

> [@Amber](#):
>
> `inAttackRange(enemy);`

Here check and only if inAttackRange(enemy) returns true attack the enemy.

Andrei

---

_[View the full topic](https://discourse.codecombat.com/t/hit-and-freeze-help-please/22840)._
