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)

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

1 Like