LUA why dose it tell me to try this.findflag but when i try replacing it it dose nothing


#1

here is my code that im using
loop
flag = this.findFlag(“green”)
item = self:findNearestItem()
distance = self:distanceTo(enemy)
if distance > 5 then self:attack(enemy)
else if flag then self:pickUpFlag(flag)
end
end
end


#2

Please read the FAQ to learn how to properly format your code.
What error are you getting, and what is it telling you to change?


#3

it just says try this.findflag


#4

Yeah I’ve noticed the LUA default code is not really up to spec.

You can try
hero:findFlag()