I am making npc moveto part position but npc stops for ~0.3 seconds while walking
and this happens every time
local Player = script.Parent.Parent.Parent.Parent.Parent
local Tycoons = game.Workspace.Tycoon.Tycoons
local OwnedTycoon = Player.OwnedTycoon
local Item = script.Parent.Values.Item
local TimeToReady = script.Parent.Values.TimeToReady
local Give = script.Parent.Values.Give
local Animation = script:WaitForChild('Animation')
script.Parent.Send.MouseButton1Click:Connect(function()
local PlrTycoon = Tycoons:FindFirstChild(OwnedTycoon.Value)
local Lake = PlrTycoon.PurchasedObjects:WaitForChild("Lake") --- Lake
local Fisher = PlrTycoon.PurchasedObjects:WaitForChild("Fisher") --- NPC
local Humanoid = Fisher.Humanoid
local StartPos = Lake.StartZone
local FinishPos = Lake.FishingZone
---Move--
local PathfindingService = game:GetService("PathfindingService")
local Path = PathfindingService:CreatePath()
Path:ComputeAsync(Fisher.Torso.Position, FinishPos.Position)
local Waypoints = Path:GetWaypoints()
for _, waypoint in pairs(Waypoints) do
Humanoid:MoveTo(waypoint.Position)
Humanoid.MoveToFinished:Wait()
end
wait(5)
local Path = PathfindingService:CreatePath()
Path:ComputeAsync(Fisher.Torso.Position, StartPos.Position)
local Waypoints = Path:GetWaypoints()
for _, waypoint in pairs(Waypoints) do
Humanoid:MoveTo(waypoint.Position)
Humanoid.MoveToFinished:Wait()
end
end)
Sorry if my english is bad and you cant understand what i wrote)