Why isn't my combat working after the return?

Alright, so basically. I have a system in place where if a character has a certain effect they’ll automatically be unable to attack back, preventing you hitting during a combo, but for some reason, I’ll be unable to punch again after this?

WERK = Combat.OnServerEvent:Connect(function(Player, Count)
	-- removed Count = 0
	local Character = Player.Character
	local Humanoid = Character.Humanoid
	local Humrp = Character.HumanoidRootPart

	if Character:GetAttribute("IsBlocking") == true then
		return
	end


	if Character.Effects:FindFirstChild("Stun") then
		return
	end
	


	if not Character.Effects:FindFirstChild("Stun") then
		print("UGHHH?")


		Character:SetAttribute("CanAttack", true)

		print("WERKKKK")

		local Action, Length = CM.getAnimation(Humanoid, Count)

		Action:Play()
		CM.NormalCombat(Player, Character, 5, "Fists", Count, Length)
		print(Count)


		wait(Length)


	--[[==[local KeyList = {}
	for key, value in pairs(Key) do
		table.insert(KeyList, key)
	end
 
	if not Character:FindFirstChild("Stun") then
		if Humanoid:FindFirstChild("Clashing").Value == true then
			print("It works")
			print(Key[KeyList[math.random(#KeyList)])
			Clashin:FireClient(Player, "Clashing")
			CM.Clashing(Player, Character, Humrp, Key)
			
		end
	end
	]]--

		if Count < 4 then
			Combat:FireClient(Player, false)
			Character:SetAttribute("CanAttack", false)	
		else
			Combat:FireClient(Player, true)
			Character:SetAttribute("CanAttack", false)

			--print(_G.CanAttack.Value)
		end
	else
		Combat:FireClient(Player, false) --Resets their cooldowns
		Character:SetAttribute("CanAttack", false)
		WERK:Disconnect()


	end

end)

(I doubt it’s the disconnections I placed amongst the script but I’ll check)


It is not the disconnections, purely if I try attacking whilst the stun is active, even after it’s removed I cannot attack.