Issues with things running in parallel

I’m getting this error too and it’s messing up the AI in my game and usually occurs when I use PathfindingService.

image

I’ve been trying to debug and find out what’s going on specifically: I thought using Bindables was the problem so I removed Invoke (because I use invoke to get pathfinding) and just converted it to a local function and was thinking these parallel errors are only caused by task but now I’m getting errors on this:

image

while Building and Armor and Humanoid and Humanoid.Health > 0 do --Line 45 
	local CanContinueScan = true
	local PreviousBuildTags = ExcludedBuildTags
	local TeamTag = FindFirstInstance(Building, "Vector3Value")
	for p = 10, 0, -1 do
		if CanContinueScan == true then
			local ScanReach = 525
			if TeamTag and game.Workspace:FindFirstChild(TeamTag.Name.."BuildPlate") then
				ScanReach = (game.Workspace:FindFirstChild(TeamTag.Name.."BuildPlate").Size.Z-175)
			end
			local CurrentScanLength = (ScanReach/10)*p
			if p <= 0 then
				CurrentScanLength = -12.5
			end
			local CurrentScanPos = PlatformStand.CFrame.p+PlatformStand.CFrame.lookVector*CurrentScanLength
			local BackScanPos = PlatformStand.CFrame.p+PlatformStand.CFrame.lookVector*(CurrentScanLength+1)
			local PossibleTargetPos = PlatformStand.CFrame.p+PlatformStand.CFrame.lookVector*(ScanReach+25)
			local PathfindSetting = {AgentRadius = 15, AgentHeight = 45, AgentCanJump = true}
			local GeneratedPath = PathfindingService:CreatePath(PathfindSetting) --Erorr occurs here
			GeneratedPath:ComputeAsync(PossibleTargetPos, CurrentScanPos)
			--local HighlightPart = Instance.new("Part", game.Workspace.Debris)
			--HighlightPart.Anchored = true
			--HighlightPart.CanCollide = false
			--HighlightPart.Size = Vector3.new(1, 5000, 1)
			--HighlightPart.CFrame = CFrame.new(CurrentScanPos)
			--DebrisService:AddItem(HighlightPart, (ScanTime))
			if GeneratedPath.Status == Enum.PathStatus.Success then
				--HighlightPart.BrickColor = BrickColor.new("Bright blue")
				ScanAllyBuildings(CurrentScanPos, BackScanPos)
			else
				--HighlightPart.BrickColor = BrickColor.new("Bright yellow")
				CanContinueScan = false
				break
			end
		end
	end
	for i = 1, #PreviousBuildTags do
		if PreviousBuildTags[i] then PreviousBuildTags[i]:Destroy() end
	end
	PreviousBuildTags = {}
	wait(ScanTime)
end

Very confused on why I’m getting an error here. This doesn’t use any task stuff or use any bindables.

I’m also very clueless on how pararrel is even being called when I have the beta set to off and I also don’t have any idea how it works

image