I am trying to make a gate rise, with each part only rising a certain amount. I want the function (raiseGate) to act on all parts of the gate at once rather than doing each piece one at a time. Is there a way to do this? Thanks so much!
function raiseGate(piece)
local amount = piece.Order.Value
for i = 0, amount do
piece.CFrame = piece.CFrame + Vector3.new(0, 1.9629, 0)
wait(.2)
end
end
function onClicked()
local gates = game.workspace.GateModel:GetChildren()
for i, child in ipairs(gates) do
raiseGate(child)
wait(.1)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

5 comments
Technical note: "spawn" is a function that creates a coroutine/thread (you aren't "creating a spawn")
You shouldn't create threads when the task can be easily done without them (like chess123mate's answer) because waits are not precise and the thread manager needs to waste processing power managing all your threads.
.
@hiimgoodpack the question was "Can a Function be CALLED AGAIN BEFORE Completion?" which I answered perfectly. though I wouldn't disagree with you either.
What the OP wanted to actually do didn't need you to call a function again before it's done.