local function chase(target)
while true do
wait()
local PFS = game:GetService("PathfindingService")
local path = PFS:CreatePath()
path:ComputeAsync(SCP.HumanoidRootPart.Position, target.HumanoidRootPart.Position)
local waypoints = path:GetWaypoints()
for _, waypoint in pairs(waypoints) do
SCPHumanoid:MoveTo(waypoint.Position)
SCPHumanoid.MoveToFinished:Wait()
end
if target then
if target.Humanoid.Health == 0 then
run:Stop()
sit:Play()
SCPHumanoid.HipHeight = sitHipHeight
break
end
else
break
end
end
end
Glad to help, i was so aggrivated when mine was bugging out. The reason it was happening, was because it was looping through the wait each time which was causing it to stutter, and so by moving it, it only did the Wait() once it reached its destination.