while true do wait() print("fast print") delay(1,function() print("slow print") end) end
I have a simple setup for delay. I want "fast print" to print as fast as the while true do loop and also have "slow print" only print every one second.
when the game runs slow print only waits once then it prints as fast as the fast print.
am I doing something wrong?
Here's a wiki on when delay()
was added.
Basically,
delay()
== spawn()
+ wait()
So technically,
delay(1, function() print("slow print") end)
is
spawn(function() wait(1) print("slow print") end)
Delay doesn't yield the script so like execution time is not paused when doing delay() A better option would just put wait(1) before print('slow print')