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

:wait() as a method?

Asked by
Vathriel 510 Moderation Voter
11 years ago

I've seen wait used as a method a few times, I was wondering if any of you can explain how this works to me. Thanks. (Note: I've only seen it used on events)

1 answer

Log in to vote
-8
Answered by 11 years ago

wait() is basically telling the computer to wait until something would happen. Example:

1local P = game.Workspace.Part
2 
3function onTouch(part)
4    P.Transparency = 0
5    wait(2) --"Oh! I see the wait symbol, that means I have to wait 2 seconds until I do something!
6    P.Transparency = 1
7end
8 
9--and other function stuff here
3
I figured it out. It's a property of roblox events. It allows you to pause the script to wait for the event itself. Example: script.Parent.Touched:Wait() Assuming that the parent is of course a part. Vathriel 510 — 11y
0
Why are people hating on your awnser?!Your awnser is fine. iluvmaths1123 198 — 10y
Ad

Answer this question