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

Help with loading?

Asked by 10 years ago

How would I do a loop that waits for a model to load that has been inserted from lighting to workspace?

1 answer

Log in to vote
0
Answered by
Redbullusa 1580 Moderation Voter
10 years ago

Use a :WaitForChild() or add this inside of your function:

repeat
    wait()
until game.Workspace:FindFirstChild("ExampleModel")
1
and remember, as always, the `~= nil` is superfluous. Since you're answering the question, and repeat - until isn't that common, it might be better to use the standard line breaks and tabbing... BlueTaslem 18071 — 10y
0
Updated, thank you. Redbullusa 1580 — 10y
Ad

Answer this question