PR0J3CT11

Untitled

Aug 18th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --Ragdoll death script by Rufus14 (pure copy paste from my bow)
  3. function ragdollkill(character)
  4.     local victimshumanoid = character:findFirstChildOfClass("Humanoid")
  5.     if not character:findFirstChild("UpperTorso") then
  6.         character.Archivable = true
  7.         for i,v in pairs(character:GetChildren()) do
  8.             if v.ClassName == "Sound" then
  9.                 v:remove()
  10.             end
  11.             for q,w in pairs(v:GetChildren()) do
  12.                 if w.ClassName == "Sound" then
  13.                     w:remove()
  14.                 end
  15.             end
  16.         end
  17. stand2 = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  18. stand2.SoundId = "rbxassetid://3168463046"
  19. stand2.Volume = 10
  20.         local ragdoll = character:Clone()
  21.         ragdoll:findFirstChildOfClass("Humanoid").Health = 0
  22.         if ragdoll:findFirstChild("Health") then
  23.             if ragdoll:findFirstChild("Health").ClassName == "Script" then
  24.                 ragdoll:findFirstChild("Health").Disabled = true
  25.             end
  26.         end
  27.         for i,v in pairs(character:GetChildren()) do
  28.             if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
  29.                 v:destroy()
  30.             end
  31.         end
  32.         for i,v in pairs(character:GetChildren()) do
  33.             if v.ClassName == "Accessory" then
  34.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  35.                 if attachment1 then
  36.                     for q,w in pairs(character:GetChildren()) do
  37.                         if w.ClassName == "Part" then
  38.                             local attachment2 = w:findFirstChild(attachment1.Name)
  39.                             if attachment2 then
  40.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  41.                                 hinge.Attachment0 = attachment1
  42.                                 hinge.Attachment1 = attachment2
  43.                                 hinge.LimitsEnabled = true
  44.                                 hinge.LowerAngle = 0
  45.                                 hinge.UpperAngle = 0
  46.                             end
  47.                         end
  48.                     end
  49.                 end
  50.             end
  51.         end
  52.         ragdoll.Parent = workspace
  53.         if ragdoll:findFirstChild("Right Arm") then
  54.             local glue = Instance.new("Glue", ragdoll.Torso)
  55.             glue.Part0 = ragdoll.Torso
  56.             glue.Part1 = ragdoll:findFirstChild("Right Arm")
  57.             glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  58.             glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  59.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
  60.             limbcollider.Size = Vector3.new(1.4,1,1)
  61.             limbcollider.Shape = "Cylinder"
  62.             limbcollider.Transparency = 1
  63.             limbcollider.Name = "LimbCollider"
  64.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  65.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
  66.             limbcolliderweld.Part1 = limbcollider
  67.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  68.         end
  69.         if ragdoll:findFirstChild("Left Arm") then
  70.             local glue = Instance.new("Glue", ragdoll.Torso)
  71.             glue.Part0 = ragdoll.Torso
  72.             glue.Part1 = ragdoll:findFirstChild("Left Arm")
  73.             glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  74.             glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  75.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
  76.             limbcollider.Size = Vector3.new(1.4,1,1)
  77.             limbcollider.Shape = "Cylinder"
  78.             limbcollider.Name = "LimbCollider"
  79.             limbcollider.Transparency = 1
  80.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  81.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
  82.             limbcolliderweld.Part1 = limbcollider
  83.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  84.         end
  85.         if ragdoll:findFirstChild("Left Leg") then
  86.             local glue = Instance.new("Glue", ragdoll.Torso)
  87.             glue.Part0 = ragdoll.Torso
  88.             glue.Part1 = ragdoll:findFirstChild("Left Leg")
  89.             glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  90.             glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  91.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
  92.             limbcollider.Size = Vector3.new(1.4,1,1)
  93.             limbcollider.Shape = "Cylinder"
  94.             limbcollider.Name = "LimbCollider"
  95.             limbcollider.Transparency = 1
  96.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  97.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
  98.             limbcolliderweld.Part1 = limbcollider
  99.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  100.         end
  101.         if ragdoll:findFirstChild("Right Leg") then
  102.             local glue = Instance.new("Glue", ragdoll.Torso)
  103.             glue.Part0 = ragdoll.Torso
  104.             glue.Part1 = ragdoll:findFirstChild("Right Leg")
  105.             glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  106.             glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  107.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
  108.             limbcollider.Size = Vector3.new(1.4,1,1)
  109.             limbcollider.Shape = "Cylinder"
  110.             limbcollider.Name = "LimbCollider"
  111.             limbcollider.Transparency = 1
  112.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  113.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
  114.             limbcolliderweld.Part1 = limbcollider
  115.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  116.         end
  117.         if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then
  118.             local HeadAttachment = Instance.new("Attachment", ragdoll["Head"])
  119.             HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  120.             local connection = Instance.new('HingeConstraint', ragdoll["Head"])
  121.             connection.LimitsEnabled = true
  122.             connection.Attachment0 = ragdoll.Torso.NeckAttachment
  123.             connection.Attachment1 = HeadAttachment
  124.             connection.UpperAngle = 60
  125.             connection.LowerAngle = -60
  126.         elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then
  127.             local hedweld = Instance.new("Weld", ragdoll.Torso)
  128.             hedweld.Part0 = ragdoll.Torso
  129.             hedweld.Part1 = ragdoll.Head
  130.             hedweld.C0 = CFrame.new(0,1.5,0)
  131.         end
  132.         game.Debris:AddItem(ragdoll, 30)
  133.         wait(0.7)
  134.         if ragdoll:findFirstChildOfClass("Humanoid") then
  135.             ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
  136.         end
  137.         if ragdoll:findFirstChild("HumanoidRootPart") then
  138.             ragdoll:findFirstChild("HumanoidRootPart"):destroy()
  139.         end
  140.     elseif character:findFirstChild("UpperTorso") then
  141.         character.Archivable = true
  142.         for i,v in pairs(character:GetChildren()) do
  143.             if v.ClassName == "Sound" then
  144.                 v:remove()
  145.             end
  146.             for q,w in pairs(v:GetChildren()) do
  147.                 if w.ClassName == "Sound" then
  148.                     w:remove()
  149.                 end
  150.             end
  151.         end
  152.         local ragdoll = character:Clone()
  153.         ragdoll:findFirstChildOfClass("Humanoid").Health = 0
  154.         if ragdoll:findFirstChild("Health") then
  155.             if ragdoll:findFirstChild("Health").ClassName == "Script" then
  156.                 ragdoll:findFirstChild("Health").Disabled = true
  157.             end
  158.         end
  159.         for i,v in pairs(character:GetChildren()) do
  160.             if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then
  161.                 v:destroy()
  162.             end
  163.         end
  164.         for i,v in pairs(character:GetChildren()) do
  165.             if v.ClassName == "Accessory" then
  166.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  167.                 if attachment1 then
  168.                     for q,w in pairs(character:GetChildren()) do
  169.                         if w.ClassName == "Part" or w.ClassName == "MeshPart" then
  170.                             local attachment2 = w:findFirstChild(attachment1.Name)
  171.                             if attachment2 then
  172.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  173.                                 hinge.Attachment0 = attachment1
  174.                                 hinge.Attachment1 = attachment2
  175.                                 hinge.LimitsEnabled = true
  176.                                 hinge.LowerAngle = 0
  177.                                 hinge.UpperAngle = 0
  178.                             end
  179.                         end
  180.                     end
  181.                 end
  182.             end
  183.         end
  184.         ragdoll.Parent = workspace
  185.         local Humanoid = ragdoll:findFirstChildOfClass("Humanoid")
  186.         Humanoid.PlatformStand = true
  187.         local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper)
  188.             local connection = Instance.new('BallSocketConstraint', limb)
  189.             connection.LimitsEnabled = true
  190.             connection.Attachment0 = attachementone
  191.             connection.Attachment1 = attachmenttwo
  192.             connection.TwistLimitsEnabled = true
  193.             connection.TwistLowerAngle = twistlower
  194.             connection.TwistUpperAngle = twistupper
  195.             local limbcollider = Instance.new("Part", limb)
  196.             limbcollider.Size = Vector3.new(0.1,1,1)
  197.             limbcollider.Shape = "Cylinder"
  198.             limbcollider.Transparency = 1
  199.             limbcollider:BreakJoints()
  200.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  201.             limbcolliderweld.Part0 = limb
  202.             limbcolliderweld.Part1 = limbcollider
  203.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
  204.         end
  205.         local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper)
  206.             local connection = Instance.new('HingeConstraint', limb)
  207.             connection.LimitsEnabled = true
  208.             connection.Attachment0 = attachementone
  209.             connection.Attachment1 = attachmenttwo
  210.             connection.LimitsEnabled = true
  211.             connection.LowerAngle = lower
  212.             connection.UpperAngle = upper
  213.             local limbcollider = Instance.new("Part", limb)
  214.             limbcollider.Size = Vector3.new(0.1,1,1)
  215.             limbcollider.Shape = "Cylinder"
  216.             limbcollider.Transparency = 1
  217.             limbcollider:BreakJoints()
  218.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  219.             limbcolliderweld.Part0 = limb
  220.             limbcolliderweld.Part1 = limbcollider
  221.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
  222.         end
  223.         local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
  224.         HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  225.         makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50)
  226.         makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50)
  227.         makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180)
  228.         makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60)
  229.         makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20)
  230.         --
  231.         makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180)
  232.         makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60)
  233.         makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20)
  234.         --
  235.         makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80)
  236.         makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60)
  237.         makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20)
  238.         --
  239.         makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80)
  240.         makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60)
  241.         makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20)
  242.         for i,v in pairs(Humanoid.Parent:GetChildren()) do
  243.             if v.ClassName == "Accessory" then
  244.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  245.                 if attachment1 then
  246.                     for q,w in pairs(Humanoid.Parent:GetChildren()) do
  247.                         if w.ClassName == "Part" then
  248.                             local attachment2 = w:findFirstChild(attachment1.Name)
  249.                             if attachment2 then
  250.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  251.                                 hinge.Attachment0 = attachment1
  252.                                 hinge.Attachment1 = attachment2
  253.                                 hinge.LimitsEnabled = true
  254.                                 hinge.LowerAngle = 0
  255.                                 hinge.UpperAngle = 0
  256.                             end
  257.                         end
  258.                     end
  259.                 end
  260.             end
  261.         end
  262.         for i,v in pairs(ragdoll:GetChildren()) do
  263.             for q,w in pairs(v:GetChildren()) do
  264.                 if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] then
  265.                     w:destroy()
  266.                 end
  267.             end
  268.         end
  269.         if ragdoll:findFirstChild("HumanoidRootPart") then
  270.             ragdoll.HumanoidRootPart.Anchored = true
  271.             ragdoll.HumanoidRootPart.CanCollide = false
  272.         end
  273.         if ragdoll:findFirstChildOfClass("Humanoid") then
  274.             ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
  275.         end
  276.         game.Debris:AddItem(ragdoll, 30)
  277.     end
  278. end
  279. game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
  280.     hit1:Play()
  281. stand2:Play()
  282. end)
  283. function ded()
  284.     owner.Character:BreakJoints()
  285.     ragdollkill(owner.Character)
  286. end
  287. owner.Character:findFirstChildOfClass("Humanoid").Died:connect(ded)
Add Comment
Please, Sign In to add comment