jmiz
New Member
Posts: 3
|
Post by jmiz on Aug 31, 2016 14:15:12 GMT
Ive been fighting with this for a couple days now, and I cant figure it out... When using a For, If, or Do While loop I get syntax errors saying that it is expecting an "=" near the local variable... below is an example of a simple loop that I am trying to run, and it is not working.
local i = 0 For i < 5 toast(i) sleep(2) end
local i = 0
If i < 5 then
toast(i)
sleep(3)
i = i + 1
end
both of these give me a syntax error expecting "=" near "i" on line 2
|
|
|
Post by AnkuLua on Aug 31, 2016 15:42:14 GMT
Ive been fighting with this for a couple days now, and I cant figure it out... When using a For, If, or Do While loop I get syntax errors saying that it is expecting an "=" near the local variable... below is an example of a simple loop that I am trying to run, and it is not working. local i = 0 For i < 5 toast(i) sleep(2) end local i = 0 If i < 5 then toast(i) sleep(3) i = i + 1 end both of these give me a syntax error expecting "=" near "i" on line 2 refer to this www.lua.org/pil/4.3.4.htmlIt should be for i = 1, 5 do toast(i) sleep(2) end
|
|