How would you make a pathfinding script that moves things to the player?

I tried adjusting free model scripts, but it didn’t work, and I searched ‘pathfinding’ on the dev forum, but no luck on finding a solution, if you have questions, please ask. (I want to learn, please don’t give entire scripts) thanks!

Thedevking made a great tutorial:

I think you can set the end part to the player and recompute the path to make it follow the player, but I don’t know, i just learned this recently.

1 Like

How would you pathfind to the nearest player in a certain radius?

I tried this, but it didn’t work, and it is in a serverscript in the character (a model) also, no errors

local Path = game:GetService("PathfindingService")

local human = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("LowerTorso")

local path = Path:CreatePath()
path:ComputeAsync(torso.Position, game.Workspace.NoCross.Position)
local waypoints = path:GetWaypoints()

for i, waypoint in pairs(waypoints) do
   local part ="Part")
   part.Shape = "Ball"
   part.Material = "Neon"
   part.Size =,0.6,0.6)
   part.Anchored = true
   part.Parent = workspace
   if waypoint.Action == Enum.PathWaypointAction.Jump then


This is what is inside the model:


It would seem to be a bunch of sounds.