LUA argument error is not defined on line 2

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

The chest is not an item. You don’t need to find it. Just use self:attack("Chest")and you should be fine.

1 Like

oh heh why didnt i think of that