TheUnknownDiscord

ragdoll gun

Oct 9th, 2021 (edited)
225
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local debris = game:GetService("Debris")
  2. Bullet = Instance.new("Part", owner.Character)
  3. Bullet.Position = Vector3.new(1000000,1000000,1000000)
  4. Bullet.Anchored = true
  5. Bullet.CanCollide = false
  6. Tool = Instance.new("Tool")
  7. Tool.Name = "Ragdoll gun"
  8. Part = Instance.new("Part")
  9. Part.Name = "Handle"
  10. Part.Parent = Tool
  11. Part.Size = Vector3.new(0.47466666666,1.67733333333,3.77766666667)
  12. Tool.GripPos = Vector3.new(0,0,1.63883333334)
  13. Tool.Parent = owner.Character
  14. local E = Instance.new("RemoteEvent", owner.Character)
  15. E.Name = "The"
  16. Bullet.BrickColor = BrickColor.new("Bright yellow")
  17. Mesh = Instance.new("SpecialMesh")
  18. Mesh.Parent = Part
  19. Mesh.MeshId = "http://www.roblox.com/asset/?id=553398821"
  20. Mesh.TextureId = "http://www.roblox.com/asset/?id=553398915"
  21. Mesh.Scale = Vector3.new(0.333333333333, 0.333333333333, 0.333333333333)
  22. local Pow = Instance.new("Sound", owner.character.Head)
  23. Pow.SoundId = "rbxassetid://3810328903"
  24. Pow.Volume = 2
  25. NLS([[
  26. Tool = owner.Character:WaitForChild("Ragdoll gun")
  27. local E = owner.Character:WaitForChild("The")
  28. local toolout = false
  29. Tool.Equipped:Connect(function()
  30. toolout = true
  31. end)
  32.  
  33. Tool.Unequipped:Connect(function()
  34. toolout = false
  35. end)
  36. mouse = owner:GetMouse()
  37. mouse.Button1Down:Connect(function()
  38. if toolout then
  39. local position = mouse.Hit.Position
  40. E:FireServer(position)
  41. end
  42. end)
  43. ]],owner.PlayerGui)
  44. local velocity
  45. function killfunction(part)
  46. local Model = part:FindFirstAncestorOfClass("Model")
  47. if Model then
  48. local PC = game:GetService("Players"):GetPlayerFromCharacter(Model)
  49. if PC then
  50. if PC ~= owner then
  51. local limbcollider = Instance.new("Part", PC.Character:findFirstChild("Right Arm"))
  52. limbcollider.Size = Vector3.new(1.4,1,1)
  53. limbcollider.Shape = "Cylinder"
  54. limbcollider.Transparency = 1
  55. limbcollider.Name = "LimbCollider"
  56. local limbcolliderweld = Instance.new("Weld", limbcollider)
  57. limbcolliderweld.Part0 = PC.Character:findFirstChild("Right Arm")
  58. limbcolliderweld.Part1 = limbcollider
  59. limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  60. local limbcollider2 = Instance.new("Part", PC.Character:findFirstChild("Left Arm"))
  61. limbcollider2.Size = Vector3.new(1.4,1,1)
  62. limbcollider2.Shape = "Cylinder"
  63. limbcollider2.Transparency = 1
  64. limbcollider2.Name = "LimbCollider"
  65. local limbcolliderweld2 = Instance.new("Weld", limbcollider)
  66. limbcolliderweld2.Part0 = PC.Character:findFirstChild("Left Arm")
  67. limbcolliderweld2.Part1 = limbcollider2
  68. limbcolliderweld2.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  69. local limbcollider3 = Instance.new("Part", PC.Character:findFirstChild("Right Leg"))
  70. limbcollider3.Size = Vector3.new(1.3,1,1)
  71. limbcollider3.Shape = "Cylinder"
  72. limbcollider3.Transparency = 1
  73. limbcollider3.Name = "LimbCollider"
  74. local limbcolliderweld3 = Instance.new("Weld", limbcollider)
  75. limbcolliderweld3.Part0 = PC.Character:findFirstChild("Right Leg")
  76. limbcolliderweld3.Part1 = limbcollider3
  77. limbcolliderweld3.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  78. local limbcollider4 = Instance.new("Part", PC.Character:findFirstChild("Left Leg"))
  79. limbcollider4.Size = Vector3.new(1.3,1,1)
  80. limbcollider4.Shape = "Cylinder"
  81. limbcollider4.Transparency = 1
  82. limbcollider4.Name = "LimbCollider"
  83. local limbcolliderweld4 = Instance.new("Weld", limbcollider)
  84. limbcolliderweld4.Part0 = PC.Character:findFirstChild("Left Leg")
  85. limbcolliderweld4.Part1 = limbcollider4
  86. limbcolliderweld4.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  87. for i,v in pairs(PC.Character:GetDescendants()) do
  88. if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
  89. local Socket = Instance.new("BallSocketConstraint")
  90. local a1 = Instance.new("Attachment")
  91. local a2 = Instance.new("Attachment")
  92. a1.Parent = v.Part0
  93. a2.Parent = v.Part1
  94. Socket.Parent = v.Parent
  95. Socket.Attachment0 = a1
  96. Socket.Attachment1 = a2
  97. a1.CFrame = v.C0
  98. a2.CFrame = v.C1
  99. Socket.LimitsEnabled = true
  100. Socket.TwistLimitsEnabled = true
  101. v:Destroy()
  102. end
  103. end
  104. end
  105. end
  106. end
  107. end
  108. E.OnServerEvent:Connect(function(player, position)
  109. Pow:Play()
  110. local origin = Part.Position
  111. local direction = (position - origin).Unit*300
  112. local result = game.Workspace:Raycast(origin, direction)
  113.  
  114. local intersection = result and result.Position or origin + direction
  115. local distance = (origin - intersection).Magnitude + 2.5
  116.  
  117. local bullet_clone = Bullet:Clone()
  118. bullet_clone.Size = Vector3.new(0.1, 0.1, distance)
  119. bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2)
  120. bullet_clone.Parent = game.Workspace
  121.  
  122. if result then
  123. local part = result.Instance
  124. wait(0.1)
  125. killfunction(part)
  126. local humanoid = part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid")
  127.  
  128. if humanoid then
  129. if humanoid ~= owner.Character.Humanoid then
  130. humanoid.BreakJointsOnDeath = false
  131. wait(0.1)
  132. humanoid.Health = 0
  133. local velocity = Instance.new("BodyVelocity", part)
  134. velocity.Velocity = bullet_clone.CFrame.lookVector * 20
  135. velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  136. wait(0.125)
  137. velocity:Destroy()
  138. velocity = nil
  139. end
  140. end
  141. end
  142. wait(0.25)
  143. bullet_clone:Destroy()
  144. end)
  145.  
RAW Paste Data