loop
item = self:findNearestItem(“Chest”)
enemy = self:findNearestEnemy()
– Check the distance to the nearest enemy.
if distance = self:distanceTo(enemy) <10
– If it comes closer than 10 meters, cleave it!
then self:cleave(enemy)
else self:attack(“Chest”)
end
end
could someone tell me why its happening and how to fix it? im not understanding why its not working