Help on the Touch of death

here is my code.

while True:
enemy = hero.findNearestEnemy()
if enemy:
distance = hero.distanceTo(enemy)
if distance < 15:
# Cast “drain-life” on the enemy.
self.cast(“drain-life”, enemy)
else:
# Attack the enemy with your staff.
hero.attack(enemy)

it’s not letting me cast drain life I do not know what I’m doing wrong!

My code looks the same as yours. Do you have any of the unholy tome spell books? You need one of them to complete the level…
2021-05-13 10_26_06-Touch of Death - Learn to Code in Python, JavaScript, HTML _ CodeCombat and 3 mo

1 Like

First check if your code is properly indented, then check if you have an Unholy Tome spell book equipped that allows you to drain life.

yea my code is properly indented. And yes, I do have the proper book. I have the number 3. I just do not know what I’m doing wrong!

image

image

Your unholy tome doesn’t seem to have drain life in the screenshot.

The reason is because it is not Unholy Tome III. You have the Elemental Codex III. Instead of using the Elemental Codex books, use the Unholy Tome. You should have the first one, which allows you to cast drain-life. The Unholy Tome I looks like this:
image

1 Like

oh i get it now thx guys i will text you guys back when i equiped it.

thx guys i got the level thx for your guys help!!!

2 Likes

Mark the post that helped you the most in the bottom right corner there should be a box that says Solution, check that on the post.
image

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