Glitch with the method 'distanceTo()' in Lua

I am trying to complete Mad Maxer with Lua, however whenever I use the distanceTo() method anywhere in the code, the hero gets the Red X beneath them that indicates a syntax error. Strangely enough, there is no message that pops up, and there is no red highlight on the faulty line of code. I don’t know if this applies to other levels or if it’s just a problem with Mad Maxer, but either way, please fix this as soon as possible. Thank you!
Screenshot from 2024-05-01 14-00-04|690x331

Apparently this glitch also happens in ‘Mad Maxer Sells Out’!
Screenshot from 2024-05-01 14-10-50|690x337

Can you post a picture of your gear? If you don’t have a weapon equipped, decoys cause this glitch (and sometimes even if you do have one) but it shouldn’t affect anything for this level.