[Solved] Mind The Trap - Python

So basically, my hero.DistanceTo got its target as null. Here’s my code and here’s the error I get.

(code was here)

try and use hero.move(flag.pos)
then do this hero.attack(enemy)

1 Like

Mkay gonna try that. Thanks for the help

That would have worked if it werent for the other bit of the code. (the error is on the last if statement)

Yeah this strip of code gets null as its target.
(code was also here)

Can you give the link

Ok sure.

Ok that looks like the homepage… its not it takes you to the level

I found it don’t worry

Deleted because it was sort of a sulution

Okay, thank you Eric

I deleted it because sulution Sulution

It says “There is a problem with your code.” in the error font, and I don’t know what to change.

Can you send a screen shot and your code

(again i say, code solution but it had a typo)

You added a : at the end of distance

(code solution but it had a typo)

Oh typo lol. From now on im calling the error notification ‘The red error of death’.

Did you solve it? If you did congratulations!!

Yes, thanks. Gonna delete that screenshot incase someone stumbles upon this and gets a free answer. Oh and my code.