Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Wait or Delay? / Delay or Wait?

Asked by
Nickoakz 231 Moderation Voter
8 years ago

Just an ordinary question. Would you rather prefer or is there a better performance boost for using either delay or wait?

print("Yay") wait(10) print("Done")

or

print("Yay") delay(10,function() print("Done") end)

1
Use wait().... xuefei123 214 — 8y
0
I use wait(), never used delay and never plan on it alphawolvess 1784 — 8y
0
Delay is better, for special reasons, imagine a gun, if you use Wait() near the Blast line, it stops the whole script, but if you use delay, its much better. AIphanium 124 — 5y

1 answer

Log in to vote
4
Answered by 8 years ago

Not as far as I know, but:

Wait() stops the entire script for that time.

Delay() doesn't stop the script, it keeps going, even if x amount of seconds isn't up.

1
What delay will do is put the function into a thread and have it run simultaneous to any other code that is beyond the delay function. Example: delay(5,function() print'hello' end) print'world' will result in world hello in the output with hello being delayed. M39a9am3R 3210 — 8y
0
taht's waht I meant TheDeadlyPanther 2460 — 8y
Ad

Answer this question