local function O(O,V)for V,b in next,V:GetChildren()do local i=b:FindFirstChild(O)if i then return i end end end local V=1.3 local function b(b)local i=b.Head local I=b:WaitForChild("\072\117\109\097\110\111\105\100")local u=b["\076\101\102\116 \065\114\109"]local r=b["\076\101\102\116 \076\101\103"]local T=b["\082\105\103\104\116 \076\101\103"]local n=b["\082\105\103\104\116 \065\114\109"]local o=b.Torso I.PlatformStand=true local M=b:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if M~=nil then M:Destroy()end local g=Instance.new("\065\116\116\097\099\104\109\101\110\116")local a=Instance.new("\065\116\116\097\099\104\109\101\110\116")local v=Instance.new("\065\116\116\097\099\104\109\101\110\116")local d=Instance.new("\065\116\116\097\099\104\109\101\110\116")local K=Instance.new("\065\116\116\097\099\104\109\101\110\116")local y=Instance.new("\065\116\116\097\099\104\109\101\110\116")local c=Instance.new("\065\116\116\097\099\104\109\101\110\116")local R=Instance.new("\065\116\116\097\099\104\109\101\110\116")local Q=Instance.new("\065\116\116\097\099\104\109\101\110\116")local Z=Instance.new("\065\116\116\097\099\104\109\101\110\116")local A=Instance.new("\065\116\116\097\099\104\109\101\110\116")local s=Instance.new("\065\116\116\097\099\104\109\101\110\116")local function P()a.Name="\072\101\097\100\065"a.Parent=i a.Position=Vector3.new(0,-0.5*V,0)a.Rotation=Vector3.new(0,0,0)a.Axis=Vector3.new(1*V,0,0)a.SecondaryAxis=Vector3.new(0,1*V,0)v.Name="\076\101\102\116\065\114\109\065"v.Parent=u v.Position=Vector3.new(.5*V,1*V,0)v.Rotation=Vector3.new(0,0,0)v.Axis=Vector3.new(1*V,0,0)v.SecondaryAxis=Vector3.new(0,1*V,0)d.Name="\076\101\102\116\076\101\103\065"d.Parent=r d.Position=Vector3.new(0,1*V,0)d.Rotation=Vector3.new(0,0,0)d.Axis=Vector3.new(1*V,0,0)d.SecondaryAxis=Vector3.new(0,1*V,0)K.Name="\082\105\103\104\116\065\114\109\065"K.Parent=n K.Position=Vector3.new(-0.5*V,1*V,0)K.Rotation=Vector3.new(0,0,0)K.Axis=Vector3.new(1*V,0,0)K.SecondaryAxis=Vector3.new(0,1*V,0)y.Name="\082\105\103\104\116\076\101\103\065"y.Parent=T y.Position=Vector3.new(0,1*V,0)y.Rotation=Vector3.new(0,0,0)y.Axis=Vector3.new(1*V,0,0)y.SecondaryAxis=Vector3.new(0,1*V,0)g.Name="\114\111\111\116\065"g.Parent=M g.Position=Vector3.new(0,0,0)g.Rotation=Vector3.new(0,90*V,0)g.Axis=Vector3.new(0,0,-1*V)g.SecondaryAxis=Vector3.new(0,1*V,0)end local function x()c.Name="\084\111\114\115\111\065"c.Parent=o c.Position=Vector3.new(.5*V,-1*V,0)c.Rotation=Vector3.new(0,0,0)c.Axis=Vector3.new(1*V,0,0)c.SecondaryAxis=Vector3.new(0,1*V,0)R.Name="\084\111\114\115\111\065\049"R.Parent=o R.Position=Vector3.new(-0.5*V,-1*V,0)R.Rotation=Vector3.new(0,0,0)R.Axis=Vector3.new(1*V,0,0)R.SecondaryAxis=Vector3.new(0,1*V,0)Q.Name="\084\111\114\115\111\065\050"Q.Parent=o Q.Position=Vector3.new(-1*V,1*V,0)Q.Rotation=Vector3.new(0,0,0)Q.Axis=Vector3.new(1*V,0,0)Q.SecondaryAxis=Vector3.new(0,1*V,0)Z.Name="\084\111\114\115\111\065\051"Z.Parent=o Z.Position=Vector3.new(1*V,1*V,0)Z.Rotation=Vector3.new(0,0,0)Z.Axis=Vector3.new(1*V,0,0)Z.SecondaryAxis=Vector3.new(0,1*V,0)A.Name="\084\111\114\115\111\065\052"A.Parent=o A.Position=Vector3.new(0,1*V,0)A.Rotation=Vector3.new(0,0,0)A.Axis=Vector3.new(1*V,0,0)A.SecondaryAxis=Vector3.new(0,1*V,0)s.Name="\084\111\114\115\111\065\053"s.Parent=o s.Position=Vector3.new(0,0,0)s.Rotation=Vector3.new(0,90*V,0)s.Axis=Vector3.new(0,0,-1*V)s.SecondaryAxis=Vector3.new(0,1*V,0)end spawn(P)spawn(x)local C=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")C.Parent=u C.Attachment0=v C.Attachment1=Q C.Enabled=true C.LimitsEnabled=true C.UpperAngle=90 local k=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")k.Parent=n k.Attachment0=K k.Attachment1=Z k.Enabled=true k.LimitsEnabled=false k.UpperAngle=90 local j=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")j.Parent=i j.Attachment0=a j.Attachment1=A j.Enabled=true j.LimitsEnabled=true j.TwistLimitsEnabled=true j.UpperAngle=74 local E=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")E.Parent=o E.Attachment0=R E.Attachment1=d E.Enabled=true E.LimitsEnabled=true E.UpperAngle=90 local w=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")w.Parent=o w.Attachment0=c w.Attachment1=y w.Enabled=true w.LimitsEnabled=true w.UpperAngle=90 local p=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")p.Parent=M p.Attachment0=g p.Attachment1=s p.Enabled=true p.LimitsEnabled=true p.UpperAngle=0 i.Velocity=i.CFrame.p*(CFrame.new(0,-41*V,0)).p for V,i in next,b:GetChildren()do if i:IsA("\065\099\099\111\117\116\114\101\109\101\110\116")then for V,I in next,i:GetChildren()do if I:IsA("\066\097\115\101\080\097\114\116")then I.Parent=b i:remove()local V=I:FindFirstChildOfClass("\065\116\116\097\099\104\109\101\110\116")local u=O(V.Name,b)if u and V then local O=Instance.new("\072\105\110\103\101\067\111\110\115\116\114\097\105\110\116")O.Attachment0=u O.Attachment1=V O.LimitsEnabled=true O.UpperAngle=0 O.LowerAngle=0 O.Parent=b end end end end end end return b
-- RAGDOLL A R6 CHARACTER.

local function getAttachment0(attachmentName, char)
	for _, child in next, char:GetChildren() do
		local attachment = child:FindFirstChild(attachmentName)
		if attachment then
			return attachment
		end
	end
end

local SIZE = 1.3

local function ragdollPlayer(char)
	local head = char["Head"]
	local hum = char:WaitForChild("Humanoid")
	local leftarm = char["Left Arm"]
	local leftleg = char["Left Leg"]
	local rightleg = char["Right Leg"]
	local rightarm = char["Right Arm"]
	local torso = char.Torso
	hum.PlatformStand = true
	local root = char:FindFirstChild("HumanoidRootPart")
	if root ~= nil then
		root:Destroy()
	end
	local rootA = Instance.new("Attachment")
	local HeadA = Instance.new("Attachment")
	local LeftArmA = Instance.new("Attachment")
	local LeftLegA = Instance.new("Attachment")
	local RightArmA = Instance.new("Attachment")
	local RightLegA = Instance.new("Attachment")
	local TorsoA = Instance.new("Attachment")
	local TorsoA1 = Instance.new("Attachment")
	local TorsoA2 = Instance.new("Attachment")
	local TorsoA3 = Instance.new("Attachment")
	local TorsoA4 = Instance.new("Attachment")
	local TorsoA5 = Instance.new("Attachment")
	local function set1()
		HeadA.Name = "HeadA"
		HeadA.Parent = head
		HeadA.Position = Vector3.new(0, -0.5 * SIZE, 0)
		HeadA.Rotation = Vector3.new(0, 0, 0)
		HeadA.Axis = Vector3.new(1 * SIZE, 0, 0)
		HeadA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		LeftArmA.Name = "LeftArmA"
		LeftArmA.Parent = leftarm
		LeftArmA.Position = Vector3.new(0.5 * SIZE, 1 * SIZE, 0)
		LeftArmA.Rotation = Vector3.new(0, 0, 0)
		LeftArmA.Axis = Vector3.new(1 * SIZE, 0, 0)
		LeftArmA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		LeftLegA.Name = "LeftLegA"
		LeftLegA.Parent = leftleg
		LeftLegA.Position = Vector3.new(0, 1 * SIZE, 0)
		LeftLegA.Rotation = Vector3.new(0, 0, 0)
		LeftLegA.Axis = Vector3.new(1 * SIZE, 0, 0)
		LeftLegA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		RightArmA.Name = "RightArmA"
		RightArmA.Parent = rightarm
		RightArmA.Position = Vector3.new(-0.5 * SIZE, 1 * SIZE, 0)
		RightArmA.Rotation = Vector3.new(0, 0, 0)
		RightArmA.Axis = Vector3.new(1 * SIZE, 0, 0)
		RightArmA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		RightLegA.Name = "RightLegA"
		RightLegA.Parent = rightleg
		RightLegA.Position = Vector3.new(0, 1 * SIZE, 0)
		RightLegA.Rotation = Vector3.new(0, 0, 0)
		RightLegA.Axis = Vector3.new(1 * SIZE, 0, 0)
		RightLegA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		rootA.Name = "rootA"
		rootA.Parent = root
		rootA.Position = Vector3.new(0, 0, 0)
		rootA.Rotation = Vector3.new(0, 90 * SIZE, 0)
		rootA.Axis = Vector3.new(0, 0, -1 * SIZE)
		rootA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
	end
	local function set2()
		TorsoA.Name = "TorsoA"
		TorsoA.Parent = torso
		TorsoA.Position = Vector3.new(0.5 * SIZE, -1 * SIZE, 0)
		TorsoA.Rotation = Vector3.new(0, 0, 0)
		TorsoA.Axis = Vector3.new(1 * SIZE, 0, 0)
		TorsoA.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		TorsoA1.Name = "TorsoA1"
		TorsoA1.Parent = torso
		TorsoA1.Position = Vector3.new(-0.5 * SIZE, -1 * SIZE, 0)
		TorsoA1.Rotation = Vector3.new(0, 0, 0)
		TorsoA1.Axis = Vector3.new(1 * SIZE, 0, 0)
		TorsoA1.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		TorsoA2.Name = "TorsoA2"
		TorsoA2.Parent = torso
		TorsoA2.Position = Vector3.new(-1 * SIZE, 1 * SIZE, 0)
		TorsoA2.Rotation = Vector3.new(0, 0, 0)
		TorsoA2.Axis = Vector3.new(1 * SIZE, 0, 0)
		TorsoA2.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		TorsoA3.Name = "TorsoA3"
		TorsoA3.Parent = torso
		TorsoA3.Position = Vector3.new(1 * SIZE, 1 * SIZE, 0)
		TorsoA3.Rotation = Vector3.new(0, 0, 0)
		TorsoA3.Axis = Vector3.new(1 * SIZE, 0, 0)
		TorsoA3.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		TorsoA4.Name = "TorsoA4"
		TorsoA4.Parent = torso
		TorsoA4.Position = Vector3.new(0, 1 * SIZE, 0)
		TorsoA4.Rotation = Vector3.new(0, 0, 0)
		TorsoA4.Axis = Vector3.new(1 * SIZE, 0, 0)
		TorsoA4.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
		TorsoA5.Name = "TorsoA5"
		TorsoA5.Parent = torso
		TorsoA5.Position = Vector3.new(0, 0, 0)
		TorsoA5.Rotation = Vector3.new(0, 90 * SIZE, 0)
		TorsoA5.Axis = Vector3.new(0, 0, -1 * SIZE)
		TorsoA5.SecondaryAxis = Vector3.new(0, 1 * SIZE, 0)
	end
	spawn(set1)
	spawn(set2)
	--[[
	local HA = Instance.new("HingeConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	HA.LimitsEnabled=true
	HA.LowerAngle=0
	HA.UpperAngle=0
	--]]
	local LAT = Instance.new("BallSocketConstraint")
	LAT.Parent = leftarm
	LAT.Attachment0 = LeftArmA
	LAT.Attachment1 = TorsoA2
	LAT.Enabled = true
	LAT.LimitsEnabled = true
	LAT.UpperAngle = 90
	local RAT = Instance.new("BallSocketConstraint")
	RAT.Parent = rightarm
	RAT.Attachment0 = RightArmA
	RAT.Attachment1 = TorsoA3
	RAT.Enabled = true
	RAT.LimitsEnabled = false
	RAT.UpperAngle = 90
	local HA = Instance.new("BallSocketConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	HA.LimitsEnabled = true
	HA.TwistLimitsEnabled = true
	HA.UpperAngle = 74
	local TLL = Instance.new("BallSocketConstraint")
	TLL.Parent = torso
	TLL.Attachment0 = TorsoA1
	TLL.Attachment1 = LeftLegA
	TLL.Enabled = true
	TLL.LimitsEnabled = true
	TLL.UpperAngle = 90
	local TRL = Instance.new("BallSocketConstraint")
	TRL.Parent = torso
	TRL.Attachment0 = TorsoA
	TRL.Attachment1 = RightLegA
	TRL.Enabled = true
	TRL.LimitsEnabled = true
	TRL.UpperAngle = 90
	local RTA = Instance.new("BallSocketConstraint")
	RTA.Parent = root
	RTA.Attachment0 = rootA
	RTA.Attachment1 = TorsoA5
	RTA.Enabled = true
	RTA.LimitsEnabled = true
	RTA.UpperAngle = 0
	head.Velocity = head.CFrame.p * CFrame.new(0, -41 * SIZE, 0).p
	for _, child in next, char:GetChildren() do
		if child:IsA("Accoutrement") then
			for _, part in next, child:GetChildren() do
				if part:IsA("BasePart") then
					part.Parent = char
					child:remove()
					local attachment1 = part:FindFirstChildOfClass("Attachment")
					local attachment0 = getAttachment0(attachment1.Name, char)
					if attachment0 and attachment1 then
						local constraint = Instance.new("HingeConstraint")
						constraint.Attachment0 = attachment0
						constraint.Attachment1 = attachment1
						constraint.LimitsEnabled = true
						constraint.UpperAngle = 0
						constraint.LowerAngle = 0
						constraint.Parent = char
					end
				end
			end
		end
	end
end

return ragdollPlayer
