Can multiple functions run at the same time in my module script?

So I have one server script which basicly gets input from local clients, and then runs functions based on the key pressed. All of these functions are in one single module script, and I would like to know if multiple functions would be able to run at the same time like this?

If I have one function which takes about 10 seconds to complete, and then the user presses 3 other keys firing multiple functions in the same script, will they wait until the 10 second script is done?

Here are some exerpts from my scripts to explain their main motive:

In the server script:

local function inputFired(player, input)
functions[input](player)
end

inputEv.OnServerEvent:Connect(inputFired)

In my module script:

functions.LeftClick = function(player)
	--do something
end

functions.RightClick = function(player)
       --do something
end
1 Like

From a quick test that I did similar to what you’re trying to do, regardless if there’s a wait or not, the script will not yield till it’s finished, basically, yes multiple functions canrun at the asme time in your modulescript, regardless if there’s waits or not, so you should be fine

5 Likes