Posted 22 January 2014 - 09:30 AM
So I'm working on a little bit of code but somehow it keeps crashing if you hit a key on your keyboard.
What i want my program to do is:
if you press OK then it will continue
So i got that part to work easily(not even a challenge)
But now i don't want it to crash if you press a key.
Here is the code i use:
The error i get:
startup:45: attempt to compare nil with a number
Please help me because I need my programs set up in such a way that they don't crash and that nobody can look into the code.
What i want my program to do is:
if you press OK then it will continue
So i got that part to work easily(not even a challenge)
But now i don't want it to crash if you press a key.
Here is the code i use:
while status=="notDone" do
local event, bottun, x, y = os.pullEventRaw()
if x>23 and x<26 and y==13 then --Coordinates
status="complete"
installationp1()
else
end
end
The error i get:
startup:45: attempt to compare nil with a number
Please help me because I need my programs set up in such a way that they don't crash and that nobody can look into the code.