Ragdoll Problem

I created this script that ragdolls the player after being touched by a hitbox.
Every time you get hit by it, you get ragdolled. But when I hit someone that’s already on the ground ragdolled, they don’t ragdoll again. After that, they basically stop getting ragdolled unless you give them a little break.

Here’s the hitbox script:

hitBox.Touched:Connect(function(hit)
			local HRP = char:FindFirstChild("HumanoidRootPart")
			if not HRP then
				return
			end
			if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= plrMain.Name and not alreadyHit[hit.Parent.Name] then
				alreadyHit[hit.Parent.Name] = true
				
				task.delay(0.025, function()
					hitBox.CanTouch = false
					hitBox.Color = Color3.new(0, 1, 0)
					hitBox.Transparency = 0.3
				end)
				
				local TargetHum = hit.Parent:FindFirstChild("Humanoid")
				local TargetHRP = hit.Parent:FindFirstChild("HumanoidRootPart")
				local bodyForce = Instance.new("BodyForce")
				local knockBack = Instance.new("BodyVelocity")
				
				if not TargetHRP or not TargetHum or not knockBack or not bodyForce then
					return
				end
				
				for i, obj in TargetHRP:GetChildren() do
					if obj:IsA("BodyVelocity") then
						obj:Destroy()
					end
					if obj:IsA("BodyForce") then
						obj:Destroy()
					end
				end
				
				local hitSnd = script.Hit:Clone()
				
				bodyForce.Force = Vector3.new(0, bounceForce, 0)
				bodyForce.Parent = TargetHRP
				
				knockBack.Parent = TargetHRP
				knockBack.MaxForce = Vector3.new(totalForce, totalForce, totalForce)
				knockBack.Velocity = hitBox.CFrame.LookVector * Speed -- Knocks back player
				
				hitSnd.Parent = HRP
				
				hitSnd:Play()
				
				hitSnd.Ended:Connect(function()
					game.Debris:AddItem(hitSnd, 0)
				end)
				
				game.Debris:AddItem(knockBack, 0.11)
				
				task.delay(0.12, function()
					bodyForce:Destroy()
				end)
				
				local hParticles = game.ReplicatedStorage.HitParticles.Attachment:Clone()
				hParticles.Parent = TargetHRP
				
				for i, particle in hParticles:GetChildren() do
					if particle:IsA("ParticleEmitter") then
						
						particle:Emit(particle:GetAttribute("EmitCount"))
						
						game.Debris:AddItem(hParticles, 1)
						
					end
				end
				
				plrMain.leaderstats.Smacks.Value += 1
				ragdollMod.Start(hit.Parent) -- Ragdolls player after getting hit
				TargetHum:TakeDamage(2.5)
				task.wait(1.75)
				ragdollMod.Stop(hit.Parent)
				alreadyHit[hit.Parent.Name] = false
			end
		end)

Here’s the module:

local ragdoll = {}

function ragdoll.Start(character)
	if character.Ragdoll.Value then return end
	character.Ragdoll.Value = true
	for i, joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") then
			
			character.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
			
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			local socket = Instance.new("BallSocketConstraint")
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			socket.Parent = joint.Parent
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint.Enabled = false
			
		end
	end
	
	character.Humanoid.WalkSpeed = 0
	character.Humanoid.JumpPower = 0
	
	character.Humanoid.PlatformStand = true
	
	character.Humanoid.AutoRotate = false
	
end

function ragdoll.Stop(character)
	local hrp = character:FindFirstChild("HumanoidRootPart")
	local hum = character:FindFirstChild("Humanoid")
	
	hum.PlatformStand = false
	character.Ragdoll.Value = false
	
	for i, joint in pairs(character:GetDescendants()) do
		if joint:IsA("BallSocketConstraint") then
			game.Debris:AddItem(joint, 0)
		end
		
		if joint:IsA("Motor6D") and character.Ragdoll.Value == false then
			joint.Enabled = true
		end
	end
	
	if character.Ragdoll.Value == true then
		return
	end
	
	hum:ChangeState(Enum.HumanoidStateType.GettingUp)
	
	hum.WalkSpeed = 16
	hum.JumpPower = 50
	
	hum.AutoRotate = true
	
end

return ragdoll

I’ve tried multiple things already, such as stopping the ragdoll before getting ragdolled again and changing the humanoid state before the joints are destroyed and restored.