[SOLVED] Hit and freeze javascript help

Please properly format your code…[Essentials] How To Post/Format Your Code Correctly

What weapon are you using? If the enemy is out of attack range, the hero will attempt to move towards it, so that it comes in range.