At game start sometimes all dragdetectors work and sometimes they dont

What solutions have you tried so far? Look for solutions on the devforum, add a wait before loading the dragdetectors, debug, no errors,

The script handles all the dragdetectors,

this is the loading:

local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")

local function setup(instance)
	local primaryPart = instance
	if instance:IsA("Model") then
		primaryPart = instance.PrimaryPart
		if not primaryPart then
			warn(`{instance.Name} (Model) has no primarypart!`)
			return
		end
	elseif not instance:IsA("BasePart") then
		warn(`{instance.Name} is not a part or a model!`)
		return
	end

	primaryPart.CollisionGroup = "Dragging"

	local dragDetector = instance:FindFirstChildWhichIsA("DragDetector")
	if not dragDetector then
		local DD = script.DragDetector:Clone()
		DD.Parent = instance
		dragDetector = DD
	end

	dragDetector.ReferenceInstance = instance

	local PosAtt = Instance.new("Attachment")
	PosAtt.Parent = primaryPart

	local AlignPos = Instance.new("AlignPosition")
	AlignPos.Parent = primaryPart
	AlignPos.Attachment0 = PosAtt
	AlignPos.Enabled = false
	AlignPos.Responsiveness = 100

	local function GetLookAtt(plr)
		local char = plr.Character
		if not char then return end

		local hrp = char:FindFirstChild("HumanoidRootPart")
		if not hrp then return end

		local Att = hrp:FindFirstChild("LookAtt")
		if Att then
			return Att
		end
	end

	local highlight

	local function onHover(plr)
		if not highlight then
			highlight = script.Highlight:Clone()
			highlight.Parent = instance
			TweenService:Create(highlight, TweenInfo.new(.5), {OutlineTransparency = 0}):Play()

			instance:SetAttribute("CurrentHighlight", plr.UserId)
		end
	end

	local function onHoverEnd(plr)
		if highlight then
			TweenService:Create(highlight, TweenInfo.new(.5), {OutlineTransparency = 1}):Play()
			Debris:AddItem(highlight, .5)
			highlight = nil

			instance:SetAttribute("CurrentHighlight", nil)
		end
	end

	dragDetector.MouseHoverEnter:Connect(onHover)
	dragDetector.MouseHoverLeave:Connect(onHoverEnd)

	local offset = 7.5
	
	local physicalproperties = primaryPart.CustomPhysicalProperties

	dragDetector.DragStart:Connect(function(plr: Player)
		local Att = GetLookAtt(plr)

		if Att then
			instance:SetAttribute("CurrentDrag", plr.UserId)
			primaryPart:SetNetworkOwner(plr)
			onHover()

			AlignPos.Attachment1 = Att
			AlignPos.Enabled = true
			
			primaryPart.CustomPhysicalProperties = PhysicalProperties.new(0.0001, 0, 0, 0, 0)

			ReplicatedStorage.Events.Drag:FireClient(plr, true)
		end
	end)

	dragDetector.DragContinue:Connect(function(plr: Player, curRay: Ray, viewFrame: CFrame)
		local Att = GetLookAtt(plr)
		pcall(function()
			primaryPart:SetNetworkOwner(plr)
		end)

		ReplicatedStorage.Events.Drag:FireClient(plr, true)

		if Att then
			local Y = viewFrame.LookVector.Y
			Att.CFrame = CFrame.new(Vector3.new(0, (Y * offset) + 1, -offset))
		end
	end)

	dragDetector.DragEnd:Connect(function(plr: Player)
		AlignPos.Enabled = false
		AlignPos.Attachment1 = nil
		instance:SetAttribute("CurrentDrag", nil)
		onHoverEnd()
		
		primaryPart.CustomPhysicalProperties = physicalproperties

		ReplicatedStorage.Events.Drag:FireClient(plr, false)

		task.delay(1, function()
			if primaryPart:GetNetworkOwner() == plr then
				primaryPart:SetNetworkOwner(nil)
			end
		end)
	end)

	dragDetector:SetPermissionPolicyFunction(function(plr: Player, part: BasePart)
		if not instance:GetAttribute("CurrentDrag") then
			return true
		end
		return false
	end)

	ReplicatedStorage.Events.Scroll.OnServerEvent:Connect(function(plr: Player, scroll: boolean)
		if instance:GetAttribute("CurrentDrag") == plr.UserId then
			if scroll then
				offset = math.clamp(offset + .5, 5, 15)
			else
				offset = math.clamp(offset - .5, 5, 15)
			end
		end
	end)

	local touching = nil

	primaryPart.Touched:Connect(function(hit)
		if hit:IsA("BasePart") and instance:GetAttribute("CurrentDrag") then
			touching = hit
			print(instance.Name.." touched "..hit.Name)
		end
	end)

	primaryPart.TouchEnded:Connect(function(hit)
		if hit:IsA("BasePart") and instance:GetAttribute("CurrentDrag") then
			touching = nil
			print(instance.Name.." stopped touched "..hit.Name)
		end
	end)

	ReplicatedStorage.Events.Weld.OnServerEvent:Connect(function(plr: Player)
		if instance:GetAttribute("CurrentDrag") == plr.UserId then
			if touching and not primaryPart:FindFirstChildWhichIsA("WeldConstraint") then
				local new = Instance.new("WeldConstraint")
				new.Part0 = touching
				new.Part1 = primaryPart
				new.Parent = primaryPart

				local sound = script.Weld:Clone()
				sound.Parent = primaryPart
				sound:Play()
				game.Debris:AddItem(sound, .5)
			end
		else
			if instance:GetAttribute("CurrentHighlight") == plr.UserId then
				primaryPart:FindFirstChildWhichIsA("WeldConstraint"):Destroy()
				local sound = script.Weld:Clone()
				sound.Parent = primaryPart
				sound:Play()
				game.Debris:AddItem(sound, .5)
			end
		end
	end)
end

CollectionService:GetInstanceAddedSignal("Pickup"):Connect(function(instance)
	task.spawn(function()
		setup(instance)
	end)
end)

task.wait(5)

for _, instance in pairs(CollectionService:GetTagged("Pickup")) do
	task.spawn(function()
		setup(instance)
	end)
end