Posted 01 December 2012 - 03:49 AM
cant get this code to work for two days XD
its about to press any key during 3 secs or the timer fires:
print("KEY OR WAIT")
while true do
local event, arg1 = os.pullEvent()
local timerID = os.startTimer(3)
if event == "timer" and arg1 == timerID then
print("My timer was first!")
return
end
if event == "key" then
print("Key was first")
return
end
end
k input works fine but timer does not fire .Can anyone help?
its about to press any key during 3 secs or the timer fires:
print("KEY OR WAIT")
while true do
local event, arg1 = os.pullEvent()
local timerID = os.startTimer(3)
if event == "timer" and arg1 == timerID then
print("My timer was first!")
return
end
if event == "key" then
print("Key was first")
return
end
end
k input works fine but timer does not fire .Can anyone help?