Hi guys!
I was making my first program tonight, and althought everything should work, I can't make the functions work.
all the code, if repeated all throughout the program, works, but it's terribly inefficient if I want to change something. So I decided to put things in function.
Ho and behold! I now get 338 errors at the "while" in each function, while they work outside of it. Here's the pastebin if someone want to take a look: http://pastebin.com/vNuYNQTK
thanks!
[Lua] [Error] function problems
Started by ssalogel, Jan 16 2013 04:31 PM
5 replies to this topic
#1
Posted 16 January 2013 - 04:31 PM
#2
Posted 16 January 2013 - 04:34 PM
I don't see how this worked before...
line 3 you have While instead of while... Lua is case sensitive
line 6 should be timeUp = timeUp + 1
line 12 you have the operator != in lua not equals is ~=
line 14 should be timeUp = timeUp - 1
line 3 you have While instead of while... Lua is case sensitive
line 6 should be timeUp = timeUp + 1
line 12 you have the operator != in lua not equals is ~=
line 14 should be timeUp = timeUp - 1
#3
Posted 16 January 2013 - 04:47 PM
uh. most of these correction are made in my program... must have pastebin the wrong one --'
case sensitive though, hadn't catch that one.
and by saying that they all worked, I meant that I had tested the concept (as in, a while detect then this and that, does it work)
tried the correction, now it's expecting a "do" on line 12... which already has a "do" >_<
http://pastebin.com/ASAvjf9m
edit: forgot to initialise timeUp. do they have a default or do they just take a "random" value, as in real life? initialising timeUp at 0 gets rid of the "do" expectation
now it's expecting an "=" on line 14... which already got one...
case sensitive though, hadn't catch that one.
and by saying that they all worked, I meant that I had tested the concept (as in, a while detect then this and that, does it work)
tried the correction, now it's expecting a "do" on line 12... which already has a "do" >_<
http://pastebin.com/ASAvjf9m
edit: forgot to initialise timeUp. do they have a default or do they just take a "random" value, as in real life? initialising timeUp at 0 gets rid of the "do" expectation
now it's expecting an "=" on line 14... which already got one...
#4
Posted 16 January 2013 - 04:50 PM
ssalogel, on 16 January 2013 - 04:47 PM, said:
and by saying that they all worked, I meant that I had tested the concept (as in, a while detect then this and that, does it work)
ssalogel, on 16 January 2013 - 04:47 PM, said:
edit: forgot to initialise timeUp. do they have a default or do they just take a "random" value, as in real life?
line 13 you are missing the () at the end of the function call
#5
Posted 16 January 2013 - 04:52 PM
Thank you! those parenthesis were the only things missing!
it works now
so, need to be more carefull next time
it works now
so, need to be more carefull next time
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











