--Import the module so you can start using itlocalServerStorage=game:GetService("ServerStorage")localSimplePath=require(ServerStorage.SimplePath)--Define npclocalDummy=workspace.Dummy-- Define a part called "Goal"localGoal=workspace.Goal--Create a new Path using the DummylocalPath=SimplePath.new(Dummy)--Helps to visualize the pathPath.Visualize=true--Compute a new path every time the Dummy reaches the goal partPath.Reached:Connect(function()Path:Run(Goal)end)--Dummy knows to compute path again if something blocks the pathPath.Blocked:Connect(function()Path:Run(Goal)end)--If the position of Goal changes at the next waypoint, compute path againPath.WaypointReached:Connect(function()Path:Run(Goal)end)--Dummmy knows to compute path again if an error occursPath.Error:Connect(function(errorType)Path:Run(Goal)end)Path:Run(Goal)
--Import the module so you can start using itlocalServerStorage=game:GetService("ServerStorage")localSimplePath=require(ServerStorage.SimplePath)--Define npclocalDummy=workspace.Dummy-- Define a part called "Goal"localGoal=workspace.Goal--Create a new Path using the DummylocalPath=SimplePath.new(Dummy)--Helps to visualize the pathPath.Visualize=truewhiletruedoPath:Run(Goal)end