Tool disappears after ragdoll

  1. What do you want to achieve?
    I want to create a successful punching glove that has the following:
    -Ragdoll for 2-3 seconds
    -Punching Animation
    -Power

  2. What is the issue?
    I made a ragdoll script that when you punch someone, they ragdoll and get launched into the players direction. When the player gets up from the impact, the tool disappears.

  3. What solutions have you tried so far?
    I tried using other un-ragdoll scripts. The same thing happens.

Script:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Ragdoller") == nil then
		local clone = script.Ragdoller:Clone()
		clone.Parent = hit.Parent
		clone.Enabled = true
	end
end)

Ragdoller:

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()
	end
end
wait(3)
for i,v in pairs(script.Parent:GetDescendants()) do
	if v:IsA("BallSocketConstraint") then
		v.UpperAngle = 0
		v.TwistUpperAngle = 0
		v.TwistLowerAngle = 0
		local Joints = Instance.new("Motor6D",v.Parent)
		Joints.Part0 = v.Attachment0.Parent
		Joints.Part1 = v.Attachment1.Parent
		Joints.C0 = v.Attachment0.CFrame
		Joints.C1 = v.Attachment1.CFrame
		v:Destroy()
	end
end
wait(1)
script:Destroy()

The game is in R6
Help please! Thanks!
Happy Holidays!
:smiley:

1 Like

I don’t know if this will work, but I think you could just replicate the tool into lighting and then back to the player

the player cant equip a tool either

If you meant that the player can’t equip a tool while ragdolled then just clone the tool to the player from lighting after the ragdoll ends

no after the ragdoll the player cant equip any tool