08-06-2011, 02:07 PM
[lua]
function waitFor(time)
local waittime = os.time()
while os.time() - waittime < time do
sleep(0.001)
end end
[/lua]
And then whenever you need to wait a bit, instead of sleep(10) use waitFor(10).
function waitFor(time)
local waittime = os.time()
while os.time() - waittime < time do
sleep(0.001)
end end
[/lua]
And then whenever you need to wait a bit, instead of sleep(10) use waitFor(10).