1

# How to add a Delay to a script?

Hey guys, I'm trying to delay something happening but it's not working very well ... can you help me?

0
Necrorave 560
7 years ago

Try adding "wait()" inside of the script.
-- Place a number within the parenthesis. That number will represent seconds.

Be sure to place it where you want to "Delay" in order to make it work correctly.

0
You should also note that the delay is in seconds. Everesty 1001 — 7y
0
Ahh, yes. Edit Incoming. Necrorave 560 — 7y
0

You need to be more specific. Do you mean wait()?

0
He's referring to the wait function, yes. Everesty 1001 — 7y
0

Delay() can also be used if you wish to use a function after a delay with two arguments (elapsed time, place time). wait() is generally a better way, though, with an argument in seconds for amour of time to wait. wait() can also be used similar to a connection line.

pathway = --put the pathway of whatever item you want to wait for here. Don't include the actual event.
pathway.event:wait()

0
phxtn 154
4 years ago
wait()

0
It's simple. Here, you can use the wait() function. The number of seconds needed to wait will be put in the parentheses. For example, 0.1 will wait for 100 milliseconds(0.1 seconds).
while true do