Help with Ragdoll

You can write your topic however you want, but you need to answer these questions:

  1. **What do you want to achieve? I want it to be set up to where if the person gets hit on the 5 hit they get ragdolled

  2. What is the issue? Include screenshots / videos if possible!
    I’ve been looking at a few ragdoll scripts but they always are just for is a person resets.
    https://gyazo.com/0d69b07d2939ff0e64f1391057f96053

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you! Here’s the script for the death on ragdoll. Idk how to add it to my combat script.

local humanoid = script.Parent:WaitForChild('Humanoid')

humanoid.BreakJointsOnDeath = false

	for index,joint in pairs(script.Parent:GetDescendants()) do
		if joint:IsA('Motor6D') then
			local socket = Instance.new('BallSocketConstraint')
			local a1 = Instance.new('Attachment')
			local a2 = Instance.new('Attachment')
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			a1.CFrame = joint.c0
			a2.CFrame = joint.c1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint:Destroy()
			local bv = Instance.new("BodyVelocity")
			bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
			bv.Velocity = script.Parent.HumanoidRootPart.CFrame.lookVector * -100
			bv.Parent = script.Parent.HumanoidRootPart
			game.Debris:AddItem(bv, .1)
		end
	end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Its never “Just a person reset”. Depending on where you originally placed your script, the variables will be created even tho its not in a character. In order to fix this you must:
1- Be sure that the character that you are applying the script to is the same rigtype as the script (r6/r15)
2- That the script is inserted inside the character model

How would I do that exactly? there’s 2 other scripts besides the ragdoll one.

  1. Is the local script for combat
    and 2. Is the other script for combat.
    should I send those too?

Just copy the code that you posted above, create a new script inside the character model and paste all the code there.

I forgot to answer this. I figured it out. I basically made a separate script which is where the ragdoll happens on the server then I took my combat script and triggered it on the server as well, so when on the fifth hit you get ragdolled