--


function ragdollkill(character)
	local victimshumanoid = character:findFirstChildOfClass("Humanoid")
	local checkragd = character:findFirstChild("ragded")
	if not checkragd then
		local boolvalue = Instance.new("BoolValue", character)
		boolvalue.Name = "ragded"
		if not character:findFirstChild("UpperTorso") then
			character.Archivable = true
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Sound" then
					v:remove()
				end
				for q,w in pairs(v:GetChildren()) do
					if w.ClassName == "Sound" then
						w:remove()
					end
				end
			end
			local ragdoll = character:Clone()
			for i,v in pairs(ragdoll:GetDescendants()) do
				if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
					v:destroy()
				end
			end
			ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
			ragdoll:findFirstChildOfClass("Humanoid").Health = 0
			if ragdoll:findFirstChild("Health") then
				if ragdoll:findFirstChild("Health").ClassName == "Script" then
					ragdoll:findFirstChild("Health").Disabled = true
				end
			end
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
					v:destroy()
				end
			end
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Accessory" then
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
					if attachment1 then
						for q,w in pairs(character:GetChildren()) do
							if w.ClassName == "Part" then
								local attachment2 = w:findFirstChild(attachment1.Name)
								if attachment2 then
									local hinge = Instance.new("HingeConstraint", v.Handle)
									hinge.Attachment0 = attachment1
									hinge.Attachment1 = attachment2
									hinge.LimitsEnabled = true
									hinge.LowerAngle = 0
									hinge.UpperAngle = 0
								end
							end
						end
					end
				end
			end
			ragdoll.Parent = workspace
			if ragdoll:findFirstChild("Right Arm") then
				local glue = Instance.new("Glue", ragdoll.Torso)
				glue.Part0 = ragdoll.Torso
				glue.Part1 = ragdoll:findFirstChild("Right Arm")
				glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
				glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
				limbcollider.Size = Vector3.new(1.4,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Transparency = 1
				limbcollider.Name = "LimbCollider"
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
			end
			if ragdoll:findFirstChild("Left Arm") then
				local glue = Instance.new("Glue", ragdoll.Torso)
				glue.Part0 = ragdoll.Torso
				glue.Part1 = ragdoll:findFirstChild("Left Arm")
				glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
				glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
				limbcollider.Size = Vector3.new(1.4,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Name = "LimbCollider"
				limbcollider.Transparency = 1
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
			end
			if ragdoll:findFirstChild("Left Leg") then
				local glue = Instance.new("Glue", ragdoll.Torso)
				glue.Part0 = ragdoll.Torso
				glue.Part1 = ragdoll:findFirstChild("Left Leg")
				glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
				glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
				limbcollider.Size = Vector3.new(1.4,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Name = "LimbCollider"
				limbcollider.Transparency = 1
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
			end
			if ragdoll:findFirstChild("Right Leg") then
				local glue = Instance.new("Glue", ragdoll.Torso)
				glue.Part0 = ragdoll.Torso
				glue.Part1 = ragdoll:findFirstChild("Right Leg")
				glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
				glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
				local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
				limbcollider.Size = Vector3.new(1.4,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Name = "LimbCollider"
				limbcollider.Transparency = 1
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
			end
			if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then
				local HeadAttachment = Instance.new("Attachment", ragdoll["Head"])
				HeadAttachment.Position = Vector3.new(0, -0.5, 0)
				local connection = Instance.new('HingeConstraint', ragdoll["Head"])
				connection.LimitsEnabled = true
				connection.Attachment0 = ragdoll.Torso.NeckAttachment
				connection.Attachment1 = HeadAttachment
				connection.UpperAngle = 60
				connection.LowerAngle = -60
			elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then
				local hedweld = Instance.new("Weld", ragdoll.Torso)
				hedweld.Part0 = ragdoll.Torso
				hedweld.Part1 = ragdoll.Head
				hedweld.C0 = CFrame.new(0,1.5,0)
			end
			game.Debris:AddItem(ragdoll, 30)
			local function aaaalol()
				wait(0.2)
				local function searchforvelocity(wot)
					for i,v in pairs(wot:GetChildren()) do
						searchforvelocity(v)
						if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
							v:destroy()
						end
					end
				end
				searchforvelocity(ragdoll)
				wait(0.5)
				if ragdoll:findFirstChildOfClass("Humanoid") then
					ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
				end
				if ragdoll:findFirstChild("HumanoidRootPart") then
					ragdoll:findFirstChild("HumanoidRootPart"):destroy()
				end
			end
			spawn(aaaalol)
		elseif character:findFirstChild("UpperTorso") then
			character.Archivable = true
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Sound" then
					v:remove()
				end
				for q,w in pairs(v:GetChildren()) do
					if w.ClassName == "Sound" then
						w:remove()
					end
				end
			end
			local ragdoll = character:Clone()
			ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
			for i,v in pairs(ragdoll:GetDescendants()) do
				if v.ClassName == "Motor" or v.ClassName == "Motor6D" then
					v:destroy()
				end
			end
			ragdoll:BreakJoints()
			ragdoll:findFirstChildOfClass("Humanoid").Health = 0
			if ragdoll:findFirstChild("Health") then
				if ragdoll:findFirstChild("Health").ClassName == "Script" then
					ragdoll:findFirstChild("Health").Disabled = true
				end
			end
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then
					v:destroy()
				end
			end
			for i,v in pairs(character:GetChildren()) do
				if v.ClassName == "Accessory" then
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
					if attachment1 then
						for q,w in pairs(character:GetChildren()) do
							if w.ClassName == "Part" or w.ClassName == "MeshPart" then
								local attachment2 = w:findFirstChild(attachment1.Name)
								if attachment2 then
									local hinge = Instance.new("HingeConstraint", v.Handle)
									hinge.Attachment0 = attachment1
									hinge.Attachment1 = attachment2
									hinge.LimitsEnabled = true
									hinge.LowerAngle = 0
									hinge.UpperAngle = 0
								end
							end
						end
					end
				end
			end
			ragdoll.Parent = workspace
			local Humanoid = ragdoll:findFirstChildOfClass("Humanoid")
			Humanoid.PlatformStand = true
			local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper)
				local connection = Instance.new('BallSocketConstraint', limb)
				connection.LimitsEnabled = true
				connection.Attachment0 = attachementone
				connection.Attachment1 = attachmenttwo
				connection.TwistLimitsEnabled = true
				connection.TwistLowerAngle = twistlower
				connection.TwistUpperAngle = twistupper
				local limbcollider = Instance.new("Part", limb)
				limbcollider.Size = Vector3.new(0.1,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Transparency = 1
				limbcollider:BreakJoints()
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = limb
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
			end
			local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper)
				local connection = Instance.new('HingeConstraint', limb)
				connection.LimitsEnabled = true
				connection.Attachment0 = attachementone
				connection.Attachment1 = attachmenttwo
				connection.LimitsEnabled = true
				connection.LowerAngle = lower
				connection.UpperAngle = upper
				local limbcollider = Instance.new("Part", limb)
				limbcollider.Size = Vector3.new(0.1,1,1)
				limbcollider.Shape = "Cylinder"
				limbcollider.Transparency = 1
				limbcollider:BreakJoints()
				local limbcolliderweld = Instance.new("Weld", limbcollider)
				limbcolliderweld.Part0 = limb
				limbcolliderweld.Part1 = limbcollider
				limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
			end
			local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
			HeadAttachment.Position = Vector3.new(0, -0.5, 0)
			if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then
				makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50)
			end
			makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50)
			makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180)
			makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60)
			makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20)
			--
			makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180)
			makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60)
			makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20)
			--
			makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80)
			makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60)
			makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20)
			--
			makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80)
			makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60)
			makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20)
			for i,v in pairs(Humanoid.Parent:GetChildren()) do
				if v.ClassName == "Accessory" then
					local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
					if attachment1 then
						for q,w in pairs(Humanoid.Parent:GetChildren()) do
							if w.ClassName == "Part" then
								local attachment2 = w:findFirstChild(attachment1.Name)
								if attachment2 then
									local hinge = Instance.new("HingeConstraint", v.Handle)
									hinge.Attachment0 = attachment1
									hinge.Attachment1 = attachment2
									hinge.LimitsEnabled = true
									hinge.LowerAngle = 0
									hinge.UpperAngle = 0
								end
							end
						end
					end
				end
			end
			for i,v in pairs(ragdoll:GetChildren()) do
				for q,w in pairs(v:GetChildren()) do
					if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] and w.Name ~= "ouch_weld" then
						w:destroy()
					end
				end
			end
			if ragdoll:findFirstChild("HumanoidRootPart") then
				ragdoll.HumanoidRootPart:destroy()
			end
			if ragdoll:findFirstChildOfClass("Humanoid") then
				ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
			end
			local function waitfordatmoment()
				wait(0.2)
				local function searchforvelocity(wot)
					for i,v in pairs(wot:GetChildren()) do
						searchforvelocity(v)
						if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
							v:destroy()
						end
					end
				end
				searchforvelocity(ragdoll)
			end
			spawn(waitfordatmoment)
			game.Debris:AddItem(ragdoll, 30)
		end
	end
end
function damage(what, action, t, range)
	for i,v in pairs(workspace:GetDescendants()) do
		if v.ClassName == "Model" then
			local head = v:findFirstChild("Head")
			local humanoid = v:findFirstChildOfClass("Humanoid")
			local torso = v:findFirstChild("Torso")
			local ragdolled = v:findFirstChild("ragdolledpunch")
			if humanoid and head then
				if (head.Position - what.Position).magnitude < range and v ~= character and humanoid.Health > 0 then
					if action ~= "stomp" then
						if ragdolled then
							return
						end
					end
					local ragdolledpunch = Instance.new("BoolValue", v)
					ragdolledpunch.Name = "ragdolledpunch"
					game.Debris:AddItem(ragdolledpunch, t)
					if action == "punch" then
						local velocity = Instance.new("BodyVelocity", head)
						velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
						velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(5,15)
						punchsound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						punchsound:Play()
						game.Debris:AddItem(velocity, 0.2)
					elseif action == "uppercut" then
						local velocity = Instance.new("BodyVelocity", head)
						velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
						velocity.Velocity = (character.HumanoidRootPart.CFrame.upVector * math.random(5,15)) + (character.HumanoidRootPart.CFrame.lookVector * math.random(5,15))
						kicksound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						kicksound:Play()
						game.Debris:AddItem(velocity, 0.2)
					elseif action == "kick" then
						local velocity = Instance.new("BodyVelocity", head)
						velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
						velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 20
						goresound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						goresound:Play()
						game.Debris:AddItem(velocity, 0.2)
					elseif action == "dropkick" then
						local velocity = Instance.new("BodyVelocity", head)
						velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
						velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 30
						kicksound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						kicksound:Play()
						goresound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						goresound:Play()
						game.Debris:AddItem(velocity, 0.2)
					elseif action == "stomp" then
						punchsound.PlaybackSpeed = 1+(math.random(-5,5)/15)
						punchsound:Play()
					end
					if action ~= "blocked" then
						local dmg = math.random(30,50)
						if action == "uppercut" then
							dmg = dmg + math.random(20,30)
						elseif action == "kick" then
							dmg = dmg + math.random(40,50)
						elseif action == "dropkick" then
							dmg = dmg + math.random(50,90)
						end
						if humanoid.Health <= dmg then
							humanoid.Health = 0
							ragdollkill(v)
						end
						humanoid.Health = humanoid.Health - dmg
					end
					if action ~= "blocked" and action ~= "uppercut" and action ~= "kick" and action ~= "dropkick" then
						if math.random(1,5) ~= 1 then
							return
						end
					end
					if action == "stomp" then
						return
					end
					humanoid.PlatformStand = true
					coroutine.wrap(function()
						wait(t)
						humanoid.PlatformStand = false
					end)()
					if torso then
						coroutine.wrap(function()
							humanoid = v:WaitForChild("Humanoid")
							local ragdoll = v
							if ragdoll:findFirstChild("Right Arm") then
								local glue = Instance.new("Glue", ragdoll.Torso)
								glue.Part0 = ragdoll.Torso
								glue.Part1 = ragdoll:findFirstChild("Right Arm")
								glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
								glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
								limbcollider.Size = Vector3.new(1.4,1,1)
								limbcollider.Shape = "Cylinder"
								limbcollider.Transparency = 1
								limbcollider.Name = "LimbCollider"
								local limbcolliderweld = Instance.new("Weld", limbcollider)
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
								limbcolliderweld.Part1 = limbcollider
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
								coroutine.wrap(function()
									if ragdoll.Torso:findFirstChild("Right Shoulder") then
										local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone()
										ragdoll.Torso:findFirstChild("Right Shoulder"):destroy()
										coroutine.wrap(function()
											wait(t)
											limbclone.Parent = ragdoll.Torso
											limbclone.Part0 = ragdoll.Torso
											limbclone.Part1 = ragdoll["Right Arm"]
										end)()
									end
									wait(t)
									glue:destroy()
									limbcollider:destroy()
									limbcolliderweld:destroy()
								end)()
							end
							if ragdoll:findFirstChild("Left Arm") then
								local glue = Instance.new("Glue", ragdoll.Torso)
								glue.Part0 = ragdoll.Torso
								glue.Part1 = ragdoll:findFirstChild("Left Arm")
								glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
								glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
								limbcollider.Size = Vector3.new(1.4,1,1)
								limbcollider.Shape = "Cylinder"
								limbcollider.Name = "LimbCollider"
								limbcollider.Transparency = 1
								local limbcolliderweld = Instance.new("Weld", limbcollider)
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")			
								limbcolliderweld.Part1 = limbcollider
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
								coroutine.wrap(function()
									if ragdoll.Torso:findFirstChild("Left Shoulder") then
										local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone()
										ragdoll.Torso:findFirstChild("Left Shoulder"):destroy()
										coroutine.wrap(function()
											wait(t)
											limbclone.Parent = ragdoll.Torso
											limbclone.Part0 = ragdoll.Torso
											limbclone.Part1 = ragdoll["Left Arm"]
										end)()
									end
									wait(t)
									glue:destroy()
									limbcollider:destroy()
									limbcolliderweld:destroy()
								end)()
							end
							if ragdoll:findFirstChild("Left Leg") then
								local glue = Instance.new("Glue", ragdoll.Torso)
								glue.Part0 = ragdoll.Torso
								glue.Part1 = ragdoll:findFirstChild("Left Leg")
								glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
								glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
								limbcollider.Size = Vector3.new(1.5,1,1)
								limbcollider.Shape = "Cylinder"
								limbcollider.Name = "LimbCollider"
								limbcollider.Transparency = 1
								local limbcolliderweld = Instance.new("Weld", limbcollider)
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
								limbcolliderweld.Part1 = limbcollider
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
								coroutine.wrap(function()
									if ragdoll.Torso:findFirstChild("Left Hip") then
										local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone()
										ragdoll.Torso:findFirstChild("Left Hip"):destroy()
										coroutine.wrap(function()
											wait(t)
											limbclone.Parent = ragdoll.Torso
											limbclone.Part0 = ragdoll.Torso
											limbclone.Part1 = ragdoll["Left Leg"]
										end)()
									end
									wait(t)
									glue:destroy()
									limbcollider:destroy()
									limbcolliderweld:destroy()
								end)()
							end
							if ragdoll:findFirstChild("Right Leg") then
								local glue = Instance.new("Glue", ragdoll.Torso)
								glue.Part0 = ragdoll.Torso
								glue.Part1 = ragdoll:findFirstChild("Right Leg")
								glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
								glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
								local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
								limbcollider.Size = Vector3.new(1.5,1,1)
								limbcollider.Shape = "Cylinder"
								limbcollider.Name = "LimbCollider"
								limbcollider.Transparency = 1
								local limbcolliderweld = Instance.new("Weld", limbcollider)
								limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
								limbcolliderweld.Part1 = limbcollider
								limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
								coroutine.wrap(function()
									if ragdoll.Torso:findFirstChild("Right Hip") then
										local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone()
										ragdoll.Torso:findFirstChild("Right Hip"):destroy()
										coroutine.wrap(function()
											wait(t)
											limbclone.Parent = ragdoll.Torso
											limbclone.Part0 = ragdoll.Torso
											limbclone.Part1 = ragdoll["Right Leg"]
										end)()
									end
									wait(t)
									glue:destroy()
									limbcollider:destroy()
									limbcolliderweld:destroy()
								end)()
							end
						end)()
					end
				end
			end
		end
	end
end