Loop Error in Lua


#1

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


#2

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

--Use a loop to help defeat the enemy!

loop

end


With nothing else?


#3

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

#4

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!


#5

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


#6

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