Would this be suitable and efficient? Or would it be just laggy?
start = tick()
end = tick()
while start - end ~= 10 then
wait()
end = tick()
end
print("10 seconds!")
Would this be suitable and efficient? Or would it be just laggy?
start = tick()
end = tick()
while start - end ~= 10 then
wait()
end = tick()
end
print("10 seconds!")
There is only one small problem with this, What if the line "start - end ~= 10" is bigger than 10 or skips over 10 seconds.
You probably would also want this as part of a function:-
function chkTime(startTime, limit)
return tick() - startTime <= limit -- this will return true or false which will be used for the while loop
end
local curTime = tick()
while chkTime(curTime, 10) do wait() end
print('ended')
Hope this helps
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Just use wait(10).
you can't use "end" as a variable name.