So I had this script:
local pathFindingService = game:GetService("PathfindingService")
local human = script.Parent:WaitForChild("Humanoid")
local HumanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local endPoints = script.Parent.Parent.Parent:WaitForChild("NPCEnd"):GetChildren()
while true do
local xpos = math.random(0.5, 5)
local zpos = math.random(0.5, 5)
local randomEndPoint = endPoints[math.random(1, #endPoints)]
local randPos = randomEndPoint.Position + Vector3.new(xpos, 0, zpos)
local path = pathFindingService:CreatePath()
path:ComputeAsync(HumanoidRootPart.Position, randPos)
local waypoitns = path:GetWaypoints()
print(waypoitns)
for i, waypoint in pairs(waypoitns) do
human:MoveTo(waypoint.Position)
human.MoveToFinished:Wait(2)
end
wait(math.random(1, 5))
end
and it worked perfectly fine yesterday, but today it does not work at all!
Does anyone have any idea what is wrong, or is there just a problem with pathfinding service right now?