(There is a lot of stuff behind this)
function down2() for _, unit in pairs(selection) do local path = game:GetService("PathfindingService"):ComputeRawPathAsync(unit.Torso.Position, mouse.Hit.p, 250) local points = path:GetPointCoordinates() local followingPath = false if not followingPath then followingPath = true -- Ask the server to calculate a path for us for _, point in pairs(points) do unit.Humanoid:MoveTo(point) -- Don't try moving to the next point until we are close enough to the current point in the path repeat unit.Humanoid:MoveTo(point) distance = (point - unit.Torso.Position).magnitude wait() until distance < 3 end end followingPath = false end end mouse.Button2Down:connect(down2)
It moves all units but not at the same time, when the first one that walks reaches the point the next ones come. I need it so all units would walk all at once to the point where you right click.