When I try my hero moves to the other enemies and he leaves his place.
Don’t let ogres step into the grove.
def onSpawn():
while True:
scout = pet.findNearestByType(“scout”)
if scout and pet.isReady(“charm”):
pet.charm(scout)
Assign the event handler to the pet’s “spawn” event.
pet.on(“spawn”, onSpawn)
Fight!
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
@Eric_Tang, could you please post your code correctly in the future, like @Lydia_Song said. Since it is such a short code, I can read it, and the issue with this level is probably your items. If you are using glasses like the twilight glasses, your hero can see to the other side of the map and will attack enemies there. What I suggest doing is equipping glasses that are actually worse and don’t give you as much range. Hope this helps!
Grzmot