enemy1 = self.findNearestenemy()
loop:
if self.isReady("cleave"):
self.cleave(enemy1)
else:
self.attack("Chest")
I tried this but it says “Found a expression but expected a statement: loop” what??? in line 2,
also all of the ‘self’ are in red
and ‘loop’ is not blue.
I thought it was because i changed the programming code but when i checked it, it was still PYTHON (DEFAULT)
i hit save again, and the same thing happened…
Try inserting self.findNearestEnemy() in the loop.
Also i suggest you put a condition if the distance from you to the enemy is less then 10, only then cleave.
Good luck
@tsepten It was good to check that you were still in Python, but I think it somehow still got you switched to some other language. Can you try switching to Python at the same time as changing your hero?
# If the ogres rush at you, cleave them!
# If they stay 10 meters away, attack the "Chest".
loop:
enemy = self.findNearestEnemy()
self.distanceTo(enemy.pos)
if self.distanceTo(enemy) > 10 :
self.attack("Chest")
else:
self.cleave(enemy)
self.attack(enemy)
self.attack(enemy)
that almost worked… It was just that my sword is too weak and I cant buy a new one since i dont have enough gems… the only way is to but extra gems which I will never do.
I don’t know why ppl got problem with gem , I am on the last mission on forest map and still got 1000 gems , and i haven’t bought any sword , use the one u have earned so far and you’re good to go
As you can see in the code i gave you already , i add a normal attack under cleave , so if cleave isn’t enough you gona kill them by attack , that’s it