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

How can I continue a loop that has a wait?

Asked by 7 years ago
Edited 7 years ago

Hello! I need some help. I have a function with a wait inside that needs to run with a loop that breaks (in this case, a GetChildren command), but since the function has a wait in it, it only repeats after the last request to run the function has finished.

Example of issue (not my original code):

for index, child in pairs(workspace:GetChildren()) do
    say(child)
end

say(child)
    print(child)
    wait(10)
end

Thanks, danclay

Answer this question