Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Explanation of :wait?

What does :wait mean instead of wait()?

2 answers

✓ Accepted answer

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!

4 comments

0

Thanks dude!

0

No problem! :)

0

Congrats on getting 100 reputation! ;)

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. :)

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"

5 comments

1

No, ':wait()' is also used. :P

0

He means the :wait() method.

0

Yeah, that's what I mean.

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()'

0

Sorry for whoever got mad enough to dislike my answer just because I misunderstood the question and fixed it. Jeez.

This discussion is preserved as it was. New answers, comments, and votes are closed.