Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

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
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)


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?


it just says try this.findflag


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

You can try