Or just use the filter
method/function (it’s a function in Python but method in JavaScript)
1 Like
I just do this:
cat = hero.findNearestByType("catapult")
if cat:
hero.attack(cat)
if enemy and Not cat:
#put code here
Note: this is python
Not should be lowercase btw
Yeah. Sorry about that mistake
Sometimes you just need to submit it several times and then you will pass the level.
Sould be this:
cat = pet.findNearestByType("catapult")
if cat:
hero.attack(cat)
if enemy and Not cat:
#put code here
I see no changes, also, the Not
shouldn’t be capitalized
Hero can’t ‘findNearestByType(“catapult”)’
2 Likes
yes they can lol, if u have the max glasses or smthn u can bro
Why pet? hero.findNearestByType()
worked fine for me. Also, what if you don’t have a pet?
Note: you need at least fine telephono glasses
hero.findNearestByType
doesn’t exist, it’s hero.findByType
or hero.findNearest
1 Like
Oh. I meant hero.findByType
Instead. Thanks for the correction!
1 Like
well, person1 is not active anymore i guess he finished the level, let’s just wait😁