I’ve tried and asked other people but they don’t know either.
In the picture it shows the parts being stacked because PathfindingService results in NoPath every single time.
I just tested it after removing the wall in between and it has the exact same results.
local current = nil
local hitspeed = Config.HitSpeed
local hitdmg = Config.HitDamage
local recalc = Config.RecalculationTime
function DoPath(target)
if not target or not (target == current) then return nil end
local path = Pathfind:FindPathAsync(Hrp.Position, target.Position)
if not (path.Status.Value == 0) then print(path.Status) -- prints Enum.PathStatus.NoPath every time
Instance.new("Part", workspace).Position = Hrp.Position
Instance.new("Part", workspace).Position = target.Position
wait(recalc.Value)
return DoPath(target)
end
local waypoints = path:GetWaypoints()
for i,point in pairs(waypoints) do print'd'
if not (current == target) then return nil end
if point.PathWaypointAction == Enum.PathWaypointAction.Walk then print'1'
Hum:MoveTo(point.Position)
local arrived = Hum.MoveToFinished:Wait()
if not arrived then print'2'
return DoPath(Hrp.Position, target.Position)
end print'3'
elseif point.PathWaypointAction == Enum.PathWaypointAction.Jump then
Hum:MoveTo(point.Position)
Hum.Jump = true
local arrived = Hum.MoveToFinished:Wait()
if not arrived then
return DoPath(Hrp.Position, target.Position)
end
end
end
while current == target do print'4'
Anims.ZombieHit:Play()
wait(hitspeed.Value)
end
end