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

How do I allow a script to keep running after calling a function that waits?

1 answer

✓ Accepted answer

When you call the waitt() function, put it into a spawn() function, so it should look like this:

function waitt()
    wait(10)
end

value.Changed:connect(function()
    blah blah
    blah blah just some code
    spawn(waitt())
    blah blah
end

Honestly, I have never used the spawn() function before, but im 99% sure that this will achieve what you want to do.

Alternatively, you can do coroutines:

function waitt()
    wait(10)
end

value.Changed:connect(function()
    blah blah
    blah blah just some code
    local coro = coroutine.create(waitt)
    coroutine.resume(coro, 'whatever parameters u want for waitt() go into here where this string is')
    blah blah
end

Again, I have never used coroutines, however I have read about them and I'm also 99% sure that they will achive the desired effect for you :D

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