Advertisement
Guest User

Ragdoll Script

a guest
Mar 27th, 2020
42,370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.02 KB | None | 0 0
  1.  
  2. --R to ragdoll script. Not mine. LOL.
  3. mouse = game.Players.LocalPlayer:GetMouse()
  4. using = false
  5. ragdolling = false
  6. hit = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  7. hit.SoundId = "rbxassetid://260430060"
  8. hit.Volume = 5
  9. hit1 = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  10. hit1.SoundId = "rbxassetid://138087186"
  11. hit1.Volume = 5
  12. hit2 = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  13. hit2.SoundId = "rbxassetid://131237241"
  14. hit2.Volume = 5
  15. hit3 = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  16. hit3.SoundId = "rbxassetid://278062209"
  17. hit3.Volume = 5
  18. hit3.TimePosition = 0.33
  19. print("Press R to ragdollify.")
  20. function respawn(key)
  21.     key = key:lower()
  22.     if key == " " then ---Well, we can't press R again to UNragdoll, so it's just space.
  23.         if ragdolling then
  24.             ragdolling = false
  25.             lshclone.Parent = game.Players.LocalPlayer.Character.Torso
  26.             glue:destroy()
  27.             rshclone.Parent = game.Players.LocalPlayer.Character.Torso
  28.             glue1:destroy()
  29.             lhclone.Parent = game.Players.LocalPlayer.Character.Torso
  30.             glue11:destroy()
  31.             rhclone.Parent = game.Players.LocalPlayer.Character.Torso
  32.             glue111:destroy()
  33.             collider:destroy()
  34.             collider1:destroy()
  35.             collider11:destroy()
  36.             collider111:destroy()
  37.             sensoring:destroy()
  38.             sensoring1:destroy()
  39.             game.Players.LocalPlayer.Character.Torso.SpotLight:destroy()
  40.             game.Players.LocalPlayer.Character.Humanoid.PlatformStand = false
  41.         end
  42.     end
  43. end
  44. mouse.KeyDown:connect(respawn)
  45. function ragdoll(key)
  46.     key = key:lower()
  47.     if key == "r" then
  48.         if not ragdolling then
  49.             ragdolling = true
  50.             local light = Instance.new("SpotLight", game.Players.LocalPlayer.Character.Torso)
  51.             game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  52.             lshclone = game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:Clone()
  53. rshclone = game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:Clone()
  54. lhclone = game.Players.LocalPlayer.Character.Torso["Left Hip"]:Clone()
  55. rhclone = game.Players.LocalPlayer.Character.Torso["Right Hip"]:Clone()
  56. local leftarm = game.Players.LocalPlayer.Character["Left Arm"]
  57. local rightrm = game.Players.LocalPlayer.Character["Right Arm"]
  58. local leftleg = game.Players.LocalPlayer.Character["Left Leg"]
  59. local rightleg = game.Players.LocalPlayer.Character["Right Leg"]
  60. game.Players.LocalPlayer.Character.Torso["Left Hip"]:destroy()
  61. local head = game.Players.LocalPlayer.Character.Head
  62. glue = Instance.new("Glue", game.Players.LocalPlayer.Character.Torso)
  63. glue.Part0 = game.Players.LocalPlayer.Character.Torso
  64. glue.Part1 = leftleg
  65. glue.Name = "Left leg"
  66. collider = Instance.new("Part", leftleg)
  67. collider.Position = Vector3.new(0,999,0)
  68. collider.Size = Vector3.new(1.5, 1, 1)
  69. collider.Shape = "Cylinder"
  70. local weld = Instance.new("Weld", collider)
  71. weld.Part0 = leftleg
  72. weld.Part1 = collider
  73. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  74. collider.TopSurface = "Smooth"
  75. collider.BottomSurface = "Smooth"
  76. collider.formFactor = "Symmetric"
  77. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  78. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  79. collider.Transparency = 1
  80. ------------
  81. game.Players.LocalPlayer.Character.Torso["Right Hip"]:destroy()
  82. glue1 = Instance.new("Glue", game.Players.LocalPlayer.Character.Torso)
  83. glue1.Part0 = game.Players.LocalPlayer.Character.Torso
  84. glue1.Part1 = rightleg
  85. glue1.Name = "Right leg"
  86. collider1 = Instance.new("Part", rightleg)
  87. collider1.Position = Vector3.new(0,9999,0)
  88. collider1.Size = Vector3.new(1.5, 1, 1)
  89. collider1.Shape = "Cylinder"
  90. local weld1 = Instance.new("Weld", collider1)
  91. weld1.Part0 = rightleg
  92. weld1.Part1 = collider1
  93. weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  94. collider1.TopSurface = "Smooth"
  95. collider1.BottomSurface = "Smooth"
  96. collider1.formFactor = "Symmetric"
  97. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  98. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  99. collider1.Transparency = 1
  100. ------------
  101. game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:destroy()
  102. glue11 = Instance.new("Glue", game.Players.LocalPlayer.Character.Torso)
  103. glue11.Part0 = game.Players.LocalPlayer.Character.Torso
  104. glue11.Part1 = rightrm
  105. glue11.Name = "Right shoulder"
  106. collider11 = Instance.new("Part", rightrm)
  107. collider11.Position = Vector3.new(0,9999,0)
  108. collider11.Size = Vector3.new(1.8,1,1)
  109. collider11.Shape = "Cylinder"
  110. local weld11 = Instance.new("Weld", collider11)
  111. weld11.Part0 = rightrm
  112. weld11.Part1 = collider11
  113. weld11.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  114. collider11.TopSurface = "Smooth"
  115. collider11.BottomSurface = "Smooth"
  116. collider11.formFactor = "Symmetric"
  117. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  118. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  119. collider11.Transparency = 1
  120. ------------
  121. game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:destroy()
  122. glue111 = Instance.new("Glue", game.Players.LocalPlayer.Character.Torso)
  123. glue111.Part0 = game.Players.LocalPlayer.Character.Torso
  124. glue111.Part1 = leftarm
  125. glue111.Name = "Left shoulder"
  126. collider111 = Instance.new("Part", leftarm)
  127. collider111.Position = Vector3.new(0,9999,0)
  128. collider111.Size = Vector3.new(1.5, 1, 1)
  129. collider111.Shape = "Cylinder"
  130. local weld111 = Instance.new("Weld", collider111)
  131. weld111.Part0 = leftarm
  132. weld111.Part1 = collider111
  133. weld111.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  134. collider111.TopSurface = "Smooth"
  135. collider111.BottomSurface = "Smooth"
  136. collider111.formFactor = "Symmetric"
  137. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  138. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  139. collider111.Transparency = 1
  140. -----------------
  141. sensoring = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  142. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  143. sensoring.CanCollide = false
  144. sensoring.Position = game.Players.LocalPlayer.Character.Torso.Position
  145. local welder = Instance.new("Weld", sensoring)
  146. welder.Part0 = game.Players.LocalPlayer.Character.Torso
  147. welder.Part1 = sensoring
  148. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  149. sensoring.Transparency = 1
  150. -----------------
  151. sensoring1 = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  152. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  153. sensoring1.CanCollide = false
  154. sensoring1.Position = game.Players.LocalPlayer.Character.Torso.Position
  155. local welder1 = Instance.new("Weld", sensoring)
  156. welder1.Part0 = game.Players.LocalPlayer.Character.Torso
  157. welder1.Part1 = sensoring1
  158. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  159. sensoring1.Transparency = 1
  160. local function touch()
  161.     if not using then
  162.         using = true
  163.         local Math = math.random(1,4)
  164.         if Math == 1 then
  165.             hit:Play()
  166.         end
  167.         if Math == 2 then
  168.             hit1:Play()
  169.         end
  170.         if Math == 3 then
  171.             hit2:Play()
  172.         end
  173.         if Math == 4 then
  174.             hit3:Play()
  175.         end
  176.         wait(0.1)
  177.         using = false
  178.     end
  179. end
  180. sensoring.Touched:connect(touch)
  181. sensoring1.Touched:connect(touch)
  182.         end
  183.  
  184.     end
  185. end
  186. mouse.KeyDown:connect(ragdoll)
  187. --di ent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement