local NPC = script.Parent
local ha = script.Parent:FindFirstChildWhichIsA("Humanoid")
local pathfinding_service = game:GetService("PathfindingService")
local debounce = false
local tabl = {game.Workspace.P1,game.Workspace.P2,game.Workspace.p3}
local Pathrough = tabl[math.random(1, #tabl)]
local Prompts = {
[1] = ("Moving.");
[2] = ("Heading To Location.");
[3] = ("Moving To Location");
};
coroutine.wrap(function()
while wait(2) do
print((ha.Parent.HumanoidRootPart.Position - Pathrough.Position).Magnitude )
end
end)()
while wait(2) do
local path = pathfinding_service:CreatePath()
path:ComputeAsync(NPC.HumanoidRootPart.Position, Pathrough.Position, 10000)
local waypoints = path:GetWaypoints()
for _, waypoint in pairs(waypoints) do
if waypoint.Action == Enum.PathWaypointAction.Jump then
ha.Jump = true
end
end
for _, waypoint in pairs(waypoints) do
ha:MoveTo(waypoint.Position)
script.Parent.Monsta.MoveToFinished:Connect(function()
script.Disabled = true
wait(1)
script.Disabled =false
end)
end
end
the error is
PathfindingService: path request is too long. - Server - pathfind:22
How do i increase the range? thanks for help