When character dies it glitches

When the character dies it dies like 100 times and I cant do anything about it! For my knowledge the problem is the ragdoll module script listed here:

	if not char:FindFirstChild("Ragdolled") then
		local ragval = Instance.new("NumberValue")
		ragval.Name = "Ragdolled"
		ragval.Parent = char
		ragval.Value = timer
		for i, v in pairs(char:GetDescendants()) do
			if v:IsA("BallSocketConstraint") then
				v.Enabled = true
			end
			if v:IsA("Motor6D") then
				v.Enabled = false
			end
		end
		print("Target Successfully Ragdolled!")
		for i=1, ragval.Value do
			task.wait(1)
			ragval.Value -= 1
		end
		ragdoll.Stand(char)
	else
		char:FindFirstChild("Ragdolled").Value += timer
		print("Failed To Ragdoll Enemy Due To Stuff.")
	end
end
function ragdoll.Stand(char)
	if char:FindFirstChild("Ragdolled") then
		char:FindFirstChild("Ragdolled"):Destroy()
	end
	for i, v in pairs(char:GetDescendants()) do
		if v:IsA("BallSocketConstraint") then
			v.Enabled = false
		end
		if v:IsA("Motor6D") then
			v.Enabled = true
		end
	end
	print("Target Successfully Stood Up!")
end

Here is a video of the problem:
robloxapp-20231117-1942005.wmv (1.2 MB)
please help.

2 Likes

Does the problem happen if you disable the ragdoll script?

1 Like

Nope, not at all I also tried to remove the Motor6Ds of the character which also didn’t work.

1 Like

Maybe it is the BreakJointsOnDeath property of your humanoid.

Screen Shot 2023-11-17 at 6.55.20 PM

1 Like

Its already set in one of the scripts when you spawn in.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.