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

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

1 Like

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?

1 Like

it just says try this.findflag

1 Like

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

You can try
hero:findFlag()

1 Like