✓ Accepted answer
You're confused so I'll just make you a script and comment some explanations. This is a script & there is only 1 of them inside of the model of the NPC.
wait(.5)
local player = script.Parent
local target = game.Workspace.Finish.Position
local PFind = game:GetService("PathfindingService")
local Path = PFind:ComputeRawPathAsync(player:WaitForChild("Torso"), target, 500)
if Path.Status == Enum.PathStatus.Success then
for _ , Vector3 in pairs(Path:GetPointCoordinates()) do
player:WaitForChild("Humanoid"):MoveTo(Vector3)
repeat wait()
local magnitude = (player.Torso.Position - Vector3).magnitude
until magnitude < 3
end
end
If this DOES NOT WORK, please comment bellow with the exact error, I have not tested this because I didn't have an NPC made to try it. If this works and you have questions, ask any questions and I will answer, also, don't forget to accept my answer if this works!
2 comments
it works ty
Np