This isn’t my script, but I edited it to be able to unragdoll too. Basically, as you can see in the video, the legs rotate fine but when i try rotating the arms, they snap back. I’ve not been able to solve this issue. Here is the script:
function injury.ragdoll(bool)
if bool == nil then bool = false end
hum:ChangeState(Enum.HumanoidStateType.Physics)
for index, joint in pairs(script.Parent:GetDescendants()) do
if joint:IsA("Motor6D") and joint.Name ~= "GunM6D" and joint.Name ~= "Rugged Obsidian 9 Suppressor" and joint.Name ~= "MagM6D" then
if not isRagdolled then
hum:UnequipTools()
char.isRagdolled.Value = true
socket = Instance.new("BallSocketConstraint")
a1 = Instance.new("Attachment")
a2 = Instance.new("Attachment")
a1.Name = "ragdollat"
a2.Name = "ragdollat"
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
if joint.Name == "Right Shoulder" or joint.Name == "Left Shoulder" then --I tried adding this to fix it, didnt work
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
socket.UpperAngle = 45
socket.TwistLowerAngle = -180
socket.TwistUpperAngle = 90
end
cl = joint:Clone()
cl.Parent = joints --joints is just a folder in serverstorage
value = Instance.new("StringValue", cl)
value.Name = "jParent"
value.Value = joint.Parent.Name
joint:Destroy()
if bool then
local bv = Instance.new("BodyVelocity")
bv.Parent = script.Parent.Torso
bv.Velocity = Vector3.new(7, 0, 10)
game:GetService("Debris"):AddItem(bv, 0.05)
end
end
end
end
end```