Code:
on script load:
loop 3 times:
foo()
broadcast "2 seconds should've passed"
function foo():
wait 2 seconds
broadcast "2 seconds have passed"
output:
2 seconds should've passed
2 seconds should've passed
(2 seconds later....)
2 seconds have passed
2 seconds have passed
I would like the loop to wait for foo() to finish running before continuing. Is there a way to achieve this?
Last edited: