GaryScripts

Ragdoll Script for Roblox

Jun 10th, 2020 (edited)
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(p)
  2.     p.CharacterAdded:Connect(function(c)
  3.         c.Humanoid.BreakJointsOnDeath = false
  4.         c.Humanoid.Died:Connect(function()
  5.             for _, v in ipairs(c:GetDescendants()) do
  6.                 if v:IsA("Motor6D") then
  7.                     local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  8.                     a0.CFrame = v.C0
  9.                     a1.CFrame = v.C1
  10.                     a0.Parent = v.Part0
  11.                     a1.Parent = v.Part1
  12.                    
  13.                     local b = Instance.new("BallSocketConstraint")
  14.                     b.Attachment0 = a0
  15.                     b.Attachment1 = a1
  16.                     b.Parent = v.Part0
  17.                    
  18.                     v:Destroy()
  19.                 end
  20.             end
  21.         end)
  22.         c.HumanoidRootPart.CanCollide = false
  23.     end)
  24. end)
Add Comment
Please, Sign In to add comment