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

Loop Error in Lua


In the duelling grounds level, I tried to make a loop like it said. But it gave me this:
“Found an expression but expected a statement: while”. I tried reloading to the default and clicking “loop” under Programmaticon II. It still gave me the error. This is my code:

    -- Nothing in here

I need help!


So the sum total of your code looks something like this?

--Use a loop to help defeat the enemy!



With nothing else?


Does it work if you put some statements in there? Like this:

    local enemy = self:findNearestEnemy()
    if enemy then


I did, when there are no errors in the code inside it(nothing incomplete) it goes back to the found an expression thing! Even worse: I can’t change the language anymore!


Yep, I added stuff and the error won’t go away.


I’ve got it on the bug list, we’ll get it soon. Thanks!