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:

loop
    -- Nothing in here
end

I need help!
@nick

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

--Use a loop to help defeat the enemy!

loop

end


With nothing else?

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

loop
    local enemy = self:findNearestEnemy()
    if enemy then
        self:attack(enemy)
    end
end
1 Like

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.

1 Like

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

1 Like