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

Does a Script wait until a Module Function is finished?

Asked by
MattVSNNL 620 Moderation Voter
3 years ago

I'm coding a Mode system for a Round based game, But I got a question if the script waits until the module function is finished and then it will continue? If you know please answer, I'll accept your answer if it works, Thank you! -MattVSNNL

1 answer

Log in to vote
0
Answered by 3 years ago

Hiya,

After conducting experiments, to call module scripts and adding wait() functions into the scripts I have an answer!

Calling a function from a module function, an example I created here:

local module = {}

function module:wait()
    wait(4)
end

return module

using this code:

local x = tick() require(game.Workspace.wait):wait() print(x - tick() .. " second(s) difference while calling function!")

It waited 4 seconds, then printed

-4.0098099708557 second(s) difference while calling function!

So to answer your question, the script will continue running after the module function has finished running.

Any questions? Don't be afraid to comment, I won't bite! (????)?

0
Didn't work MattVSNNL 620 — 3y
0
What do you mean it "Didn't work"? You wanted to know if the rest of the script will continue after the module function has completed, and I have told you "the script will continue running after the module function has finished running." loowa_yawn 383 — 3y
Ad

Answer this question