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

Explanation of :wait?

Asked by 10 years ago

What does :wait mean instead of wait()?

2 answers

Log in to vote
2
Answered by 10 years ago

To me, I think it ':wait()'s until something loaded, or waits until going on, I have seen this tested before with the CharacterAdded event, and it waited a few before going on, here is an example (Randomly made, sorry if example didn't help);

game.Players.PlayerAdded:connect(function(plr) --Wheres our wait?
plr.CharacterAdded:wait() --Heres our wait!
print(plr.Character) --Prints the Player's Name
end) --The end for the PlayerAdded event

And as you'll see, it'll wait then print the Player's Character. Hope this helped!

0
Thanks dude! iluvmaths1123 198 — 10y
0
No problem! :) TheeDeathCaster 2368 — 10y
0
Congrats on getting 100 reputation! ;) iluvmaths1123 198 — 10y
0
Thanks. Been working very hard on my coding for a long time now, I started out as a -8, but now I worked to a 100+, all that hard work paid off. :) TheeDeathCaster 2368 — 10y
Ad
Log in to vote
0
Answered by
acecateer 130
10 years ago

Here are some examples of using :wait() just so you get the idea.

game.Players.Player.CharacterAdded:wait()
repeat until script.Parent.ChildAdded:wait().Name == "Child"
repeat until game.Players.Player.Changed:wait() == "TeamColor"
1
No, ':wait()' is also used. :P TheeDeathCaster 2368 — 10y
0
He means the :wait() method. kevinnight45 550 — 10y
0
Yeah, that's what I mean. acecateer 130 — 10y
0
Ohhh I see what you mean. You can do 'game.Players.Player.CharacterAdded:wait()' and it would wait for the character to respawn. I thought you meant just 'wait()' acecateer 130 — 10y
0
Sorry for whoever got mad enough to dislike my answer just because I misunderstood the question and fixed it. Jeez. acecateer 130 — 10y

Answer this question