How do I have a function run before previous function is finished running?

function startRoundGuardMove(whichGuard, guardBlock)
	whichGuard.Humanoid:MoveTo(game.Workspace.firstDestination.Position)
	whichGuard.Humanoid.MoveToFinished:Wait()
	whichGuard.Humanoid:MoveTo(guardBlock.Position)
end
startRoundGuardMove(game.Workspace.gunmen1, game.Workspace.guardBlock1)
wait(1)
startRoundGuardMove(game.Workspace.gunmen2, game.Workspace.guardBlock2)
wait(1)

basically, the point of the script is to try and have two guards move to a certain point
i want them to walk in a line, so i have a delay between calling these functions
however, the 2nd function waits for the previous function to finish before running…

how do i fix this?
also, i tried coroutines, and…

local startRoundGuardMove = coroutine.wrap(function(whichGuard, guardBlock)
	whichGuard.Humanoid:MoveTo(game.Workspace.firstDestination.Position)
	whichGuard.Humanoid.MoveToFinished:Wait()
	whichGuard.Humanoid:MoveTo(guardBlock.Position)
end)
startRoundGuardMove(game.Workspace.gunmen1, game.Workspace.guardBlock1)
wait(1)
startRoundGuardMove(game.Workspace.gunmen2, game.Workspace.guardBlock2)
wait(1)

didnt work, they just walked straight for the second destination and the second guard didnt even start moving…?

When you call a function, it waits for it to end. In the script, you have to wait longer than one second because you have included wait() inside of the function.

Instead, wrap the functions in spawn

spawn(function()
startRoundGuardMove(game.Workspace.gunmen1, game.Workspace.guardBlock1)
end)
wait(1)
spawn(function()
startRoundGuardMove(game.Workspace.gunmen2, game.Workspace.guardBlock2)
end)
wait(1)

Or, instead you can just wrap the contents of the function.

function startRoundGuardMove(whichGuard, guardBlock)
	spawn(function()
whichGuard.Humanoid:MoveTo(game.Workspace.firstDestination.Position)
	whichGuard.Humanoid.MoveToFinished:Wait()
	whichGuard.Humanoid:MoveTo(guardBlock.Position)
end)
end

Does this fix your problem?

Mayb WorldRoot:BulkMoveTo? char limit