:Died() event not firing when player stands still

I would’ve created this in engine bugs if I were a regular, because I’ve never seen this happen before.
Let me explain.

I have a R6 ragdoll system in my game, and I’ve tried everything, even network ownership.
Whenever the player stands still, nothing happens. But, whenever I go in first person and slightly rotate my camera, it then fires.

Here’s my script (it’s in ServerScriptService)

local plrs = game:GetService("Players")

plrs.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local hum = char:WaitForChild("Humanoid")
		local hrp = char:WaitForChild("HumanoidRootPart")
		local head = char:WaitForChild("Head")
		
		hum.BreakJointsOnDeath = false
		hum.Died:Connect(function()
			local chance = math.random(3)
			local vector = (chance == 1 and Vector3.new(1, 0, 0))
				or (chance == 2 and Vector3.new(0, 0, 1))
				or (chance == 3 and Vector3.new(1, 0, 1))
			
			hrp:ApplyImpulse(vector * math.random(100, 150))
			for _, joint in pairs(char:GetDescendants()) do
				if joint:IsA("Motor6D") then
					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

					joint:Destroy()
				end
			end
			
			hrp.CanCollide = false
			head.CanCollide = true
		end)
	end)
end)

I’ve also tried a ragdoll script from anotther game (this is in StarterCharacterScripts):

local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local torso = char:WaitForChild("Torso")
hum.BreakJointsOnDeath = false

hum.Died:Connect(function()
	for _, obj in pairs(char:GetDescendants()) do
		if obj:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint", obj.Parent)
			local att0 = Instance.new("Attachment", obj.Part0)
			local att1 = Instance.new("Attachment", obj.Part1)
			if att0 and att1 then
				att0.CFrame = obj.C0
				att1.CFrame = obj.C1
				socket.Attachment0 = att0
				socket.Attachment1 = att1
				socket.LimitsEnabled = true
				socket.TwistLimitsEnabled = true
				obj:Destroy()
			end
		end
	end
	torso:ApplyImpulse(Vector3.new(
		(math.random(1, 2) == 1 and -100) or 100, 
		0,
		(math.random(1, 2) == 1 and -100) or 100
	))
end)
2 Likes

it worked for me, when player died while being completely still, it didnt completely ragdoll, but the joints didnt break. (im assuming you want it to completely rag doll

1 Like

Try putting that if humanoid died and it’s health is lower than 0 or equals to 0 then activate function like this:

hum.Died:Connect(function()
    if hum.Health <= 0 then
          -- and put code of ragdoll here
    end
end)
1 Like

Yes, I do. When standing still, the joints don’t break. I want the joints to break and them be replaced by sockets. I’m not sure if this has to do with being teleported 10000 studs from up in the sky, or what’s going on.

1 Like

Still haven’t found a solution, it’s a really weird issue that I can’t seem to get rid of.