Guest User

Ragdoll Script

a guest
Apr 20th, 2018
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.46 KB | None | 0 0
  1.  
  2.  
  3. wait(2)
  4. game.Workspace.SpawnLocation:Destroy()
  5. local player = game.Players.LocalPlayer
  6. local chr = player.Character
  7. local humanoid = player.Character.Humanoid
  8.  
  9. local UIS = game:GetService("UserInputService")
  10. local cam = game.Workspace.CurrentCamera
  11. local mouse = player:GetMouse()
  12.        
  13. chr.Parent = script
  14. Model = Instance.new("Model")
  15. Model.Parent = game.Workspace
  16. Model.Name = player.Name,"Ragdoll"
  17.  
  18. for i,v in pairs(chr:GetChildren()) do
  19.     v:Clone()
  20.     v.Parent = Model
  21.     if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  22.         v.CanCollide = true
  23.     end
  24. end
  25.  
  26. for i,child in pairs(Model:GetDescendants()) do
  27.     if child:IsA("Motor6D") or child.Name == "HumanoidRootPart" then
  28.         child:Destroy()
  29.     end
  30. end
  31.  
  32.  
  33. bottom = game.Workspace.bottom
  34.  
  35. cam.CameraSubject = Model.LowerTorso
  36.  
  37. Model.Head.Parent = Model
  38. Model.LowerTorso.Parent = Model
  39. Model.UpperTorso.Parent = Model
  40. Model.LeftUpperArm.Parent = Model
  41. Model.LeftLowerArm.Parent = Model
  42. Model.LeftHand.Parent = Model
  43. Model.RightUpperArm.Parent = Model
  44. Model.RightLowerArm.Parent = Model
  45. Model.RightHand.Parent = Model
  46. Model.LeftUpperLeg.Parent = Model
  47. Model.LeftLowerLeg.Parent = Model
  48. Model.LeftFoot.Parent = Model
  49. Model.RightUpperLeg.Parent = Model
  50. Model.RightLowerLeg.Parent = Model
  51. Model.RightFoot.Parent = Model
  52.  
  53.  
  54. Neck = Instance.new("BallSocketConstraint",Model.UpperTorso)
  55. Waist = Instance.new("BallSocketConstraint",Model.LowerTorso)
  56. LeftShoulder = Instance.new("BallSocketConstraint",Model.UpperTorso)
  57. RightShoulder = Instance.new("BallSocketConstraint",Model.UpperTorso)
  58. LeftHip = Instance.new("BallSocketConstraint",Model.LowerTorso)
  59. RightHip = Instance.new("BallSocketConstraint",Model.LowerTorso)
  60. LeftElbow = Instance.new("BallSocketConstraint",Model.UpperTorso)
  61. RightElbow = Instance.new("BallSocketConstraint",Model.UpperTorso)
  62. LeftKnee = Instance.new("BallSocketConstraint",Model.LowerTorso)
  63. RightKnee = Instance.new("BallSocketConstraint",Model.LowerTorso)
  64. LeftWrist = Instance.new("BallSocketConstraint",Model.UpperTorso)
  65. RightWrist = Instance.new("BallSocketConstraint",Model.UpperTorso)
  66. RightAnkle = Instance.new("BallSocketConstraint",Model.LowerTorso)
  67. LeftAnkle = Instance.new("BallSocketConstraint",Model.LowerTorso)
  68.  
  69.  
  70. Neck.Attachment0 = Model.UpperTorso.NeckRigAttachment
  71. Neck.Attachment1 = Model.Head.NeckRigAttachment
  72. Neck.LimitsEnabled = true
  73.  
  74. Waist.Attachment0 = Model.LowerTorso.WaistRigAttachment
  75. Waist.Attachment1 = Model.UpperTorso.WaistRigAttachment
  76. Waist.LimitsEnabled = true
  77.  
  78. LeftShoulder.Attachment0 = Model.UpperTorso.LeftShoulderRigAttachment
  79. LeftShoulder.Attachment1 = Model.LeftUpperArm.LeftShoulderRigAttachment
  80. LeftShoulder.LimitsEnabled = true
  81.  
  82. RightShoulder.Attachment0 = Model.UpperTorso.RightShoulderRigAttachment
  83. RightShoulder.Attachment1 = Model.RightUpperArm.RightShoulderRigAttachment
  84. RightShoulder.LimitsEnabled = true
  85.  
  86. LeftHip.Attachment0 = Model.LowerTorso.LeftHipRigAttachment
  87. LeftHip.Attachment1 = Model.LeftUpperLeg.LeftHipRigAttachment
  88. LeftHip.LimitsEnabled = true
  89.  
  90. RightHip.Attachment0 = Model.LowerTorso.LeftHipRigAttachment
  91. RightHip.Attachment1 = Model.RightUpperLeg.RightHipRigAttachment
  92. RightHip.LimitsEnabled = true
  93.  
  94. LeftElbow.Attachment0 = Model.LeftUpperArm.LeftElbowRigAttachment
  95. LeftElbow.Attachment1 = Model.LeftLowerArm.LeftElbowRigAttachment
  96. LeftElbow.LimitsEnabled = true
  97.  
  98. RightElbow.Attachment0 = Model.RightUpperArm.RightElbowRigAttachment
  99. RightElbow.Attachment1 = Model.RightLowerArm.RightElbowRigAttachment
  100. RightElbow.LimitsEnabled = true
  101.  
  102. LeftKnee.Attachment0 = Model.LeftUpperLeg.LeftKneeRigAttachment
  103. LeftKnee.Attachment1 = Model.LeftLowerLeg.LeftKneeRigAttachment
  104. LeftKnee.LimitsEnabled = true
  105.  
  106. RightKnee.Attachment0 = Model.RightUpperLeg.RightKneeRigAttachment
  107. RightKnee.Attachment1 = Model.RightLowerLeg.RightKneeRigAttachment
  108. RightKnee.LimitsEnabled = true
  109.  
  110. LeftWrist.Attachment0 = Model.LeftLowerArm.LeftWristRigAttachment
  111. LeftWrist.Attachment1 = Model.LeftHand.LeftWristRigAttachment
  112. LeftWrist.LimitsEnabled = true
  113.  
  114. RightWrist.Attachment0 = Model.RightLowerArm.RightWristRigAttachment
  115. RightWrist.Attachment1 = Model.RightHand.RightWristRigAttachment
  116. RightWrist.LimitsEnabled = true
  117.  
  118. LeftAnkle.Attachment0 = Model.LeftLowerLeg.LeftAnkleRigAttachment
  119. LeftAnkle.Attachment1 = Model.LeftFoot.LeftAnkleRigAttachment
  120. LeftAnkle.LimitsEnabled = true
  121.  
  122. RightAnkle.Attachment0 = Model.RightLowerLeg.RightAnkleRigAttachment
  123. RightAnkle.Attachment1 = Model.RightFoot.RightAnkleRigAttachment
  124. RightAnkle.LimitsEnabled = true
Advertisement
Add Comment
Please, Sign In to add comment