Ragdoll Script Glitch

I was working on a Ragdoll Script
I need the player to fall down if the Humanoid Health is equal or lower than 30

  • The issue

Instead of falling down, the player floats weirdly

  • However when the Humanoid Dies it falls down normally

Here is my Script (in ServerScriptService)


game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(c)
		c.Humanoid.BreakJointsOnDeath = false
		c.Humanoid.HealthChanged:Connect(function()
			if c.Humanoid.Health < 30 then
			for _, v in pairs(c:GetDescendants()) do
					if v:IsA("Motor6D") then
						c.HumanoidRootPart.CanCollide = false
					local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
					a0.CFrame = v.C0
					a1.CFrame = v.C1
					a0.Parent = v.Part0
					a1.Parent = v.Part1

					local b = Instance.new("BallSocketConstraint")
					b.Attachment0 = a0
					b.Attachment1 = a1
					b.Parent = v.Part0

					v:Destroy()
					end
				end
			end
			c.HumanoidRootPart.CanCollide = false
		end)
	end)
end)
  • Thanks for reading! I hope someone has a solution
1 Like

try setting the humanoidstate to fallingdown on a local script

Ill try that and keep you updated on the Results.
Thanks!

Set humanoid state to physics.

To unragdoll simply set the state to getting up. It’s how I do it

I was abit confused,
is this how to change the HumanoidStateType?

local phys = Enum.HumanoidStateType.Physics
						c.Humanoid:ChangeState(phys)

Edit: According to the API this is correct, it didn’t seem to work

Try adding Humanoid.StateChanged function and change the state like that.

i did exactly that,
I set the State to Dead

c.Humanoid:ChangeState(Enum.HumanoidStateType.Dead)

It still doesn’t seem to work.

I only got the script working on the client. Not sure why it’s doing this on the server. I assume it’s networking issues because the constraints are set on the server and not the client.

Try implementing a setnetworkowner function.

I think i might need to take another path. I have my older ragdoll script that works fine, but what i was trying to do,

  • create a tool that can drag the player.
    The old ragdoll script didn’t work with that since i could not clic on the Torso.
    So i decided to create a new one.
    But since the new one is glitchy and im not sure that i would be able to make it work
  • ill create a ProximityPrompt when the player is ragdolled, and the other players may drag the player by Triggering the Prompt then Setting the Ragdolled Torso’s CFrame to the Player that drags.

Ill send you the script when its done

1 Like