Hey guys, I have been learning Lua recently and have ran into a bit of an issue, every time I try to run the code bellow I get an error (missing end to close function) but no matter how many times I look at it, I see an end closing the function..
I'm sure I have made a massive error I just can't see it for all the looking
function walk()
local clear = robot.detect()
if clear == true then -- if block forward
while clear == true do -- while it is true
local upClear = robot.detectUp()
if upClear == true then
robot.up() -- fly