carlosname

a

Jul 17th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --By Rufus14
  2. script.Name = "Spin"
  3. script.Parent = owner.Character
  4. --Converted with ttyyuu12345's model to script plugin v4
  5. function sandbox(var,func)
  6.     local env = getfenv(func)
  7.     local newenv = setmetatable({},{
  8.         __index = function(self,k)
  9.             if k=="script" then
  10.                 return var
  11.             else
  12.                 return env[k]
  13.             end
  14.         end,
  15.     })
  16.     setfenv(func,newenv)
  17.     return func
  18. end
  19. cors = {}
  20. mas = Instance.new("Model",game:GetService("Lighting"))
  21. Tool0 = Instance.new("Tool")
  22. Part1 = Instance.new("Part")
  23. SpecialMesh2 = Instance.new("SpecialMesh")
  24. Sound3 = Instance.new("Sound")
  25. Sound4 = Instance.new("Sound")
  26. Sound5 = Instance.new("Sound")
  27. Sound6 = Instance.new("Sound")
  28. Sound7 = Instance.new("Sound")
  29. Sound8 = Instance.new("Sound")
  30. Sound9 = Instance.new("Sound")
  31. Sound10 = Instance.new("Sound")
  32. RemoteEvent11 = Instance.new("RemoteEvent")
  33. Tool0.Name = "Pistol"
  34. Tool0.Parent = mas
  35. Tool0.TextureId = "rbxassetid://0"
  36. Tool0.CanBeDropped = false
  37. Tool0.Grip = CFrame.new(-0.0662693828, -0.275076389, -0.4518933, -0.998969376, 0, 0.0453881398, 0, 1, 0, -0.0453881398, 0, -0.998969376)
  38. Tool0.GripForward = Vector3.new(-0.0453881398, -0, 0.998969376)
  39. Tool0.GripPos = Vector3.new(-0.0662693828, -0.275076389, -0.4518933)
  40. Tool0.GripRight = Vector3.new(-0.998969376, 0, -0.0453881398)
  41. Tool0.ToolTip = "Make people spin"
  42. Part1.Name = "Handle"
  43. Part1.Parent = Tool0
  44. Part1.CFrame = CFrame.new(1.84143364, 0.946836948, -16.1359825, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  45. Part1.Position = Vector3.new(1.84143364, 999999, -16.1359825)
  46. Part1.Size = Vector3.new(0.230000198, 0.0500000007, 0.290000528)
  47. Part1.BottomSurface = Enum.SurfaceType.Smooth
  48. Part1.TopSurface = Enum.SurfaceType.Smooth
  49. SpecialMesh2.Parent = Part1
  50. SpecialMesh2.MeshId = "rbxassetid://0"
  51. SpecialMesh2.Scale = Vector3.new(0.0299999993, 0.0299999993, 0.0299999993)
  52. SpecialMesh2.TextureId = "rbxassetid://436697889"
  53. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  54. Sound3.Name = "shatter"
  55. Sound3.Parent = Part1
  56. Sound3.SoundId = "rbxassetid://2978605361"
  57. Sound3.PlaybackSpeed = 2
  58. Sound4.Name = "gunshot"
  59. Sound4.Parent = Part1
  60. Sound4.Pitch = 1.2000000476837
  61. Sound4.PlaybackSpeed = 1.2000000476837
  62. Sound4.SoundId = "rbxassetid://2400424487"
  63. Sound5.Name = "empty"
  64. Sound5.Parent = Part1
  65. Sound5.SoundId = "rbxassetid://1347142405"
  66. Sound6.Name = "equip"
  67. Sound6.Parent = Part1
  68. Sound6.SoundId = "rbxassetid://2531000707"
  69. Sound7.Name = "unequip"
  70. Sound7.Parent = Part1
  71. Sound7.SoundId = "rbxassetid://769464514"
  72. Sound8.Name = "supersonic bullet crack"
  73. Sound8.Parent = Part1
  74. Sound8.EmitterSize = 1
  75. Sound8.MinDistance = 1
  76. Sound8.Pitch = 1.5
  77. Sound8.PlaybackSpeed = 1.5
  78. Sound8.SoundId = "rbxassetid://259586543"
  79. Sound8.Volume = 1
  80. Sound9.Name = "bullethitflesh"
  81. Sound9.Parent = Part1
  82. Sound9.SoundId = "rbxassetid://3092866899"
  83. Sound10.Name = "bullethit"
  84. Sound10.Parent = Part1
  85. Sound10.SoundId = "rbxassetid://1489924400"
  86. RemoteEvent11.Name = "GunEvent"
  87. RemoteEvent11.Parent = Tool0
  88. for i,v in pairs(mas:GetChildren()) do
  89.     v.Parent = script
  90.     pcall(function() v:MakeJoints() end)
  91. end
  92. mas:Destroy()
  93. for i,v in pairs(cors) do
  94.     spawn(function()
  95.         pcall(v)
  96.     end)
  97. end
  98. Tool0.Parent = script
  99. NLS([[
  100. game:GetService("Players").LocalPlayer.Character:WaitForChild("Spin")
  101. game:GetService("Players").LocalPlayer.Character.Spin.Pistol:WaitForChild("GunEvent")
  102. print("script ran")
  103. tool = game:GetService("Players").LocalPlayer.Character.Spin.Pistol
  104. playermouse = game:GetService("Players").LocalPlayer:GetMouse()
  105. runservice = game:GetService("RunService").RenderStepped
  106. gunevent = tool.GunEvent
  107. function onpress()
  108.     gunevent:FireServer("shoot", playermouse.Hit.p, playermouse.Origin.p)
  109. end
  110. tool.Activated:connect(onpress)
  111. function removearms()
  112.     if game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("RightArmWeld") then
  113.         game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("RightArmWeld"):destroy()
  114.     end
  115.     if game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("HeadWeld") then
  116.         game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("HeadWeld"):destroy()
  117.     end
  118.     if game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("LeftArmWeld") then
  119.         game:GetService("Players").LocalPlayer.Character.Torso:findFirstChild("LeftArmWeld"):destroy()
  120.     end
  121.     if game:GetService("Players").LocalPlayer.Character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeld") then
  122.         game:GetService("Players").LocalPlayer.Character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeld"):destroy()
  123.     end
  124. end
  125. tool.Unequipped:connect(removearms)
  126. while runservice:wait() do
  127.     if tool.Parent == game:GetService("Players").LocalPlayer.Character then
  128.         if (workspace.CurrentCamera.CFrame.p - game:GetService("Players").LocalPlayer.Character.Head.Position).magnitude < 1.3 then
  129.             if game:GetService("Players").LocalPlayer.Character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeld") then
  130.                 gunevent:FireServer("point", playermouse.Hit.p, playermouse.Origin.p)
  131.                 game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.HumanoidRootPartWeld.C0 = CFrame.fromEulerAnglesXYZ(0,math.pi/3,0)
  132.             else
  133.                 local humanoidrootpart = Instance.new("Weld", game:GetService("Players").LocalPlayer.Character.HumanoidRootPart)
  134.                 humanoidrootpart.Part0 = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart
  135.                 humanoidrootpart.Part1 = game:GetService("Players").LocalPlayer.Character.Torso
  136.                 humanoidrootpart.Name = "HumanoidRootPartWeld"
  137.             end
  138.         else
  139.             if game:GetService("Players").LocalPlayer.Character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeld") then
  140.                 game:GetService("Players").LocalPlayer.Character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeld"):destroy()
  141.             end
  142.             gunevent:FireServer("point", playermouse.Hit.p, playermouse.Origin.p)
  143.             game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(playermouse.Hit.p.x,game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.y,playermouse.Hit.p.z)) * CFrame.fromEulerAnglesXYZ(0,math.pi/3,0)
  144.         end
  145.     end
  146. end
  147. ]], owner.Character)
  148. wait(0.8)
  149. --By Rufus14
  150. canuse = true
  151. heartbeat = game:GetService("RunService").Heartbeat
  152. tool = Tool0
  153. handle = Part1
  154. shoot = handle.gunshot
  155. shattersound = handle.shatter
  156. empty = handle.empty
  157. shootevent = tool.GunEvent
  158. equip = handle.equip
  159. unequip = handle.unequip
  160. bullethitflesh = handle.bullethitflesh
  161. bullethit = handle.bullethit
  162. bulletcrack = handle["supersonic bullet crack"]
  163. function positiongun()
  164.     equip:Play()
  165. end
  166. function resetgun()
  167.     unequip:Play()
  168. end
  169. tool.Unequipped:connect(resetgun)
  170. tool.Equipped:connect(positiongun)
  171. Tool0.Parent = owner.Character
  172. function dosomething(plr, whataction, pos, origin)
  173.     if whataction == "shoot" then
  174.         if canuse then
  175.             canuse = false
  176.             shoot:Play()
  177.             for i = 1,10 do
  178.                 plr.Character.Torso:findFirstChild("RightArmWeld").C1 = plr.Character.Torso:findFirstChild("RightArmWeld").C1 * CFrame.fromEulerAnglesXYZ(-0.055,0,0)
  179.             end
  180.             local light = Instance.new("PointLight", handle)
  181.             light.Brightness = 10
  182.             local ray = Ray.new(handle.Position, (pos - handle.Position).unit * 400)
  183.             local hit, position = workspace:FindPartOnRayWithIgnoreList(ray, {handle, tool.Parent["Right Arm"]})
  184.             local part = Instance.new("Part", handle)
  185.             part.Anchored = true
  186.             part.CanCollide = false
  187.             part.Material = "Neon"
  188.             part.Size = Vector3.new(0,0,(handle.Position - position).magnitude/4)
  189.             part.CFrame = CFrame.new(handle.Position, position) * CFrame.new(0,0,-(handle.Position - position).magnitude/2)
  190.             local function hide()
  191.                 bulletcrack.Parent = part
  192.                 bulletcrack:Play()
  193.                 bulletcrack.MaxDistance = part.Size.z
  194.                 wait(0.01)
  195.                 part.Transparency = 1
  196.                 wait(bulletcrack.TimeLength - 0.01)
  197.                 bulletcrack.Parent = handle
  198.                 part:destroy()
  199.             end
  200.             spawn(hide)
  201.             game.Debris:AddItem(light, 0.04)
  202.             local function makewound(hitt)
  203.                 local ball = Instance.new("Part", hitt.Parent)
  204.                 ball.Shape = "Ball"
  205.                 ball.Name = "ouchwound"
  206.                 ball.Transparency = hitt.Transparency
  207.                 ball.CanCollide = false
  208.                 ball.Size = Vector3.new(0.25,0.25,0.25)
  209.                 ball.CFrame = CFrame.new(position.x,position.y,position.z)
  210.                 local hitweld = Instance.new("Weld", hitt)
  211.                 ball.CFrame = CFrame.new(ball.Position, handle.Position)
  212.                 hitweld.C0 = hitt.CFrame:toObjectSpace(ball.CFrame)
  213.                 hitweld.Part0 = hitt
  214.                 hitweld.Part1 = ball
  215.                 hitweld.Name = "ouch_weld"
  216.                 hitweld.C0 = hitweld.C0 * CFrame.new(0,0,0.1)
  217.                 bullethit.Parent = ball
  218.                 if hitt.Name == "ouchwound" then
  219.                     ball.Transparency = 1
  220.                     local function waittoremove()
  221.                         wait(3)
  222.                         ball:destroy()
  223.                     end
  224.                     spawn(waittoremove)
  225.                 end
  226.                 bullethit:Play()
  227.                 bullethit.MaxDistance = 10
  228.                 if hitt.Parent:findFirstChildOfClass("Humanoid") then
  229.                     if hitt.Parent:findFirstChildOfClass("Humanoid").Health > 0 then
  230.                         bullethitflesh.Parent = ball
  231.                         bullethitflesh:Play()
  232.                         bullethitflesh.MaxDistance = 10
  233.                         local randomdamage = math.random(40,80)
  234.                         if hitt.Parent:findFirstChildOfClass("Humanoid").Health > 500 then
  235.                             hitt.Parent:findFirstChildOfClass("Humanoid").MaxHealth = 500
  236.                             hitt.Parent:findFirstChildOfClass("Humanoid").Health = 500
  237.                         end
  238.                         if hitt.Parent:findFirstChildOfClass("Humanoid").Health <= randomdamage then
  239.                             local velocity = Instance.new("BodyVelocity", hit)
  240.                             velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
  241.                             velocity.Velocity = handle.CFrame.lookVector * -math.random(15,25)
  242.                             game.Debris:AddItem(velocity, 0.1)
  243.                             hitt.Parent:findFirstChildOfClass("Humanoid").Health = 0
  244.                             local function searchforweld(wot)
  245.                                 for i,v in pairs(wot:GetChildren()) do
  246.                                     searchforweld(v)
  247.                                     if v.ClassName == "Weld" or v.ClassName == "Motor6D" and v.Name ~= "ouch_weld" then
  248.                                         v:destroy()
  249.                                     end
  250.                                 end
  251.                             end
  252.                             searchforweld(hitt.Parent)
  253.                             ragdollkill(hitt.Parent)
  254.                         else
  255.                             if hitt.Name ~= "Head" then
  256.                                 hitt.Parent:findFirstChildOfClass("Humanoid").Health =      hitt.Parent:findFirstChildOfClass("Humanoid").Health - randomdamage
  257.                        
  258.                                 local velocity = Instance.new("BodyVelocity", hit)
  259.                                 velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
  260.                                 velocity.Velocity = handle.CFrame.lookVector * -math.random(15,25)
  261.                                 game.Debris:AddItem(velocity, 0.1)
  262.                             else
  263.                                 hitt.Parent:findFirstChildOfClass("Humanoid").Health = 0
  264.                                 local function searchforweld(wot)
  265.                                     for i,v in pairs(wot:GetChildren()) do
  266.                                         searchforweld(v)
  267.                                         if v.ClassName == "Weld" or v.ClassName == "Motor6D" and v.Name ~= "ouch_weld" then
  268.                                             v:destroy()
  269.                                         end
  270.                                     end
  271.                                 end
  272.                                 searchforweld(hitt.Parent)
  273.                                 ragdollkill(hitt.Parent)
  274.                             end
  275.                         end
  276.                         local function bbb()
  277.                             wait(bullethitflesh.TimeLength)
  278.                             bullethitflesh.Parent = handle
  279.                         end
  280.                         spawn(bbb)
  281.                         ball.BrickColor = BrickColor.new("Maroon")
  282.                         ball.Material = "Pebble"
  283.                     end
  284.                 else
  285.                     if not hitt.Parent:findFirstChildOfClass("Humanoid") and hitt.Parent.ClassName == "Model" then
  286.                         hitt:BreakJoints()
  287.                         local velocity = Instance.new("BodyVelocity", hitt)
  288.                         velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  289.                         velocity.Velocity = handle.CFrame.lookVector * -math.random(10,30)
  290.                         local function cancollide()
  291.                             wait(0.1)
  292.                             hitt.CanCollide = true
  293.                             velocity:destroy()
  294.                         end
  295.                         spawn(cancollide)
  296.                     end
  297.                     ball.BrickColor = hitt.BrickColor
  298.                     ball.Material = "Cobblestone"
  299.                     local function fadeaway()
  300.                         wait(20)
  301.                         for i = 1,100 do
  302.                             ball.Transparency = ball.Transparency + 0.01
  303.                             wait()
  304.                         end
  305.                         ball:destroy()
  306.                     end
  307.                     spawn(fadeaway)
  308.                 end
  309.                 local function aaa()
  310.                     wait(bullethit.TimeLength)
  311.                     bullethit.Parent = handle
  312.                 end
  313.                 spawn(aaa)
  314.             end
  315.             if hit ~= nil then
  316.                 if hit.Parent ~= nil then
  317.                     if not hit.Parent:findFirstChildOfClass("Humanoid") and not hit:findFirstChild("shattered") and not hit.Name ~= "HumanoidRootPart" and hit.Transparency > 0.1 then
  318.                         if hit.Size.z < hit.Size.x then
  319.                             if hit.Size.z <= 1.5 then
  320.                                 local sha = Instance.new("BoolValue", hit)
  321.                                 sha.Name = "shattered"
  322.                                 local shatter = Instance.new("Part", workspace)
  323.                                 shatter.Transparency = hit.Transparency
  324.                                 shatter.Material = hit.Material
  325.                                 shatter.BrickColor = hit.BrickColor
  326.                                 shatter.Size = Vector3.new(hit.Size.x/2,hit.Size.y/2,hit.Size.z)
  327.                                 shatter.CanCollide = hit.CanCollide
  328.                                 shatter.CFrame = hit.CFrame * CFrame.new(shatter.Size.x/2,shatter.Size.y/2,0)
  329.                                 shatter:BreakJoints()
  330.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  331.                                 game.Debris:AddItem(shatter, 15)
  332.                                 --
  333.                                 local shatter = Instance.new("Part", workspace)
  334.                                 shatter.Transparency = hit.Transparency
  335.                                 shatter.Material = hit.Material
  336.                                 shatter.BrickColor = hit.BrickColor
  337.                                 shatter.Size = Vector3.new(hit.Size.x/2,hit.Size.y/2,hit.Size.z)
  338.                                 shatter.CanCollide = hit.CanCollide
  339.                                 shatter.CFrame = hit.CFrame * CFrame.new(-shatter.Size.x/2,shatter.Size.y/2,0)
  340.                                 shatter:BreakJoints()
  341.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  342.                                 game.Debris:AddItem(shatter, 15)
  343.                                 --
  344.                                 local shatter = Instance.new("Part", workspace)
  345.                                 shatter.Transparency = hit.Transparency
  346.                                 shatter.Material = hit.Material
  347.                                 shatter.BrickColor = hit.BrickColor
  348.                                 shatter.Size = Vector3.new(hit.Size.x/2,hit.Size.y/2,hit.Size.z)
  349.                                 shatter.CanCollide = hit.CanCollide
  350.                                 shatter.CFrame = hit.CFrame * CFrame.new(shatter.Size.x/2,-shatter.Size.y/2,0)
  351.                                 shatter:BreakJoints()
  352.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  353.                                 game.Debris:AddItem(shatter, 15)
  354.                                 --
  355.                                 local shatter = Instance.new("Part", workspace)
  356.                                 shatter.Transparency = hit.Transparency
  357.                                 shatter.Material = hit.Material
  358.                                 shatter.BrickColor = hit.BrickColor
  359.                                 shatter.Size = Vector3.new(hit.Size.x/2,hit.Size.y/2,hit.Size.z)
  360.                                 shatter.CanCollide = hit.CanCollide
  361.                                 shatter.CFrame = hit.CFrame * CFrame.new(-shatter.Size.x/2,-shatter.Size.y/2,0)
  362.                                 shatter:BreakJoints()
  363.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  364.                                 game.Debris:AddItem(shatter, 15)
  365.                                 --
  366.                                 hit.Anchored = true
  367.                                 hit.Transparency = 1
  368.                                 hit.CanCollide = false
  369.                                 local function stopshattering()
  370.                                     shattersound.Parent = hit
  371.                                     shattersound:Play()
  372.                                     shattersound.MaxDistance = 30
  373.                                     game.Debris:AddItem(hit,2)
  374.                                     wait(shattersound.TimeLength/2)
  375.                                     shattersound.Parent = handle
  376.                                 end
  377.                                 spawn(stopshattering)
  378.                             end
  379.                         elseif hit.Size.x < hit.Size.z then
  380.                             if hit.Size.x <= 1.5 then
  381.                                 local sha = Instance.new("BoolValue", hit)
  382.                                 sha.Name = "shattered"
  383.                                 local shatter = Instance.new("Part", workspace)
  384.                                 shatter.Transparency = hit.Transparency
  385.                                 shatter.Material = hit.Material
  386.                                 shatter.BrickColor = hit.BrickColor
  387.                                 shatter.Size = Vector3.new(hit.Size.x,hit.Size.y/2,hit.Size.z/2)
  388.                                 shatter.CanCollide = hit.CanCollide
  389.                                 shatter.CFrame = hit.CFrame * CFrame.new(0,shatter.Size.y/2,shatter.Size.z/2)
  390.                                 shatter:BreakJoints()
  391.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  392.                                 game.Debris:AddItem(shatter, 15)
  393.                                 --
  394.                                 local shatter = Instance.new("Part", workspace)
  395.                                 shatter.Transparency = hit.Transparency
  396.                                 shatter.Material = hit.Material
  397.                                 shatter.BrickColor = hit.BrickColor
  398.                                 shatter.Size = Vector3.new(hit.Size.x,hit.Size.y/2,hit.Size.z/2)
  399.                                 shatter:BreakJoints()
  400.                                 shatter.CanCollide = hit.CanCollide
  401.                                 shatter.CFrame = hit.CFrame * CFrame.new(0,-shatter.Size.y/2,shatter.Size.z/2)
  402.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  403.                                 game.Debris:AddItem(shatter, 15)
  404.                                 --
  405.                                 local shatter = Instance.new("Part", workspace)
  406.                                 shatter.Transparency = hit.Transparency
  407.                                 shatter.Material = hit.Material
  408.                                 shatter.BrickColor = hit.BrickColor
  409.                                 shatter.Size = Vector3.new(hit.Size.x,hit.Size.y/2,hit.Size.z/2)
  410.                                 shatter.CanCollide = hit.CanCollide
  411.                                 shatter.CFrame = hit.CFrame * CFrame.new(0,shatter.Size.y/2,-shatter.Size.z/2)
  412.                                 shatter:BreakJoints()
  413.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  414.                                 game.Debris:AddItem(shatter, 15)
  415.                                 --
  416.                                 local shatter = Instance.new("Part", workspace)
  417.                                 shatter.Transparency = hit.Transparency
  418.                                 shatter.Material = hit.Material
  419.                                 shatter.BrickColor = hit.BrickColor
  420.                                 shatter.Size = Vector3.new(hit.Size.x,hit.Size.y/2,hit.Size.z/2)
  421.                                 shatter.CanCollide = hit.CanCollide
  422.                                 shatter.CFrame = hit.CFrame * CFrame.new(0,-shatter.Size.y/2,-shatter.Size.z/2)
  423.                                 shatter:BreakJoints()
  424.                                 shatter.Velocity = handle.CFrame.lookVector * -20
  425.                                 game.Debris:AddItem(shatter, 15)
  426.                                 --
  427.                                 hit.Anchored = true
  428.                                 hit.Transparency = 1
  429.                                 hit.CanCollide = false
  430.                                 local function stopshattering()
  431.                                     shattersound.Parent = hit
  432.                                     shattersound:Play()
  433.                                     shattersound.MaxDistance = 30
  434.                                     game.Debris:AddItem(hit,2)
  435.                                     wait(shattersound.TimeLength/2)
  436.                                     shattersound.Parent = handle
  437.                                 end
  438.                                 spawn(stopshattering)
  439.                             end
  440.                         end
  441.                     end
  442.                 end
  443.                 if hit.Parent.ClassName == "Accessory" or hit.Parent.ClassName == "Hat" then
  444.                     for i,v in pairs(hit:GetChildren()) do
  445.                         if v.ClassName == "Attachment" or v.ClassName == "Weld" or v.ClassName == "Motor6D" then
  446.                             v:destroy()
  447.                         end
  448.                     end
  449.                     hit.Parent.Parent = workspace
  450.                     hit.CanCollide = false
  451.                     local velocity = Instance.new("BodyVelocity", hit)
  452.                     velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  453.                     velocity.Velocity = handle.CFrame.lookVector * -math.random(10,30)
  454.                     local function cancollide()
  455.                         wait(0.1)
  456.                         hit.CanCollide = true
  457.                         velocity:destroy()
  458.                     end
  459.                     spawn(cancollide)
  460.                 else
  461.                     makewound(hit)
  462.                 end
  463.             end
  464.             for i = 1,10 do
  465.                 if plr.Character.Torso:findFirstChild("RightArmWeld") then
  466.                     plr.Character.Torso:findFirstChild("RightArmWeld").C1 = plr.Character.Torso:findFirstChild("RightArmWeld").C1 * CFrame.fromEulerAnglesXYZ(0.055,0,0)
  467.                     heartbeat:wait()
  468.                 end
  469.             end
  470.             canuse = true
  471.         end
  472.     elseif whataction == "point" then
  473.         if plr.Character:findFirstChild("Torso") then
  474.             if not plr.Character.Torso:findFirstChild("HeadWeld") then
  475.                 local head = Instance.new("Weld", plr.Character.Torso)
  476.                 head.Part0 = plr.Character.Torso
  477.                 head.Part1 = plr.Character.Head
  478.                 head.C0 = CFrame.new(0,1.5,0)
  479.                 head.C1 = CFrame.new(0,-0.5,0)
  480.                 head.Name = "HeadWeld"
  481.             end
  482.             if not plr.Character.Torso:findFirstChild("RightArmWeld") then
  483.                 local rightarm = Instance.new("Weld", plr.Character.Torso)
  484.                 rightarm.Part0 = plr.Character.Torso
  485.                 rightarm.Part1 = plr.Character["Right Arm"]
  486.                 rightarm.C0 = CFrame.new(1.5,0,0)
  487.                 rightarm.C1 = CFrame.new(0,0.5,0)
  488.                 rightarm.Name = "RightArmWeld"
  489.             end
  490.             if not plr.Character.Torso:findFirstChild("LeftArmWeld") then
  491.                 local leftarm = Instance.new("Weld", plr.Character.Torso)
  492.                 leftarm.Part0 = plr.Character.Torso
  493.                 leftarm.Part1 = plr.Character["Left Arm"]
  494.                 leftarm.C0 = CFrame.new(-1.5,0,0)
  495.                 leftarm.C1 = CFrame.new(0,0.5,0)
  496.                 leftarm.Name = "LeftArmWeld"
  497.             end
  498.             if plr.Character.Torso:findFirstChild("RightArmWeld") then
  499.                 plr.Character.Torso:findFirstChild("RightArmWeld").C0 = CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,math.pi/3) * CFrame.fromEulerAnglesXYZ(math.asin((pos-origin).unit.y),0,0)
  500.             end
  501.             if plr.Character.Torso:findFirstChild("HeadWeld") then
  502.                 plr.Character.Torso:findFirstChild("HeadWeld").C0 = CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.asin((pos-origin).unit.y),-math.pi/3,0)
  503.             end
  504.             if plr.Character.Torso:findFirstChild("LeftArmWeld") then
  505.                 plr.Character.Torso:findFirstChild("LeftArmWeld").C0 = CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.asin((pos-origin).unit.y)/2,0,0)
  506.             end
  507.         end
  508.     end
  509. end
  510. shootevent.OnServerEvent:connect(dosomething)
  511. function ragdollkill(character)
  512.     local victimshumanoid = character:findFirstChildOfClass("Humanoid")
  513.     if not character:findFirstChild("UpperTorso") then
  514.         character.Archivable = true
  515.         for i,v in pairs(character:GetChildren()) do
  516.             if v.ClassName == "Sound" then
  517.                 v:remove()
  518.             end
  519.             for q,w in pairs(v:GetChildren()) do
  520.                 if w.ClassName == "Sound" then
  521.                     w:remove()
  522.                 end
  523.             end
  524.         end
  525.         local ragdoll = character:Clone()
  526.         ragdoll:findFirstChildOfClass("Humanoid").Health = 0
  527.         if ragdoll:findFirstChild("Health") then
  528.             if ragdoll:findFirstChild("Health").ClassName == "Script" then
  529.                 ragdoll:findFirstChild("Health").Disabled = true
  530.             end
  531.         end
  532.         for i,v in pairs(character:GetChildren()) do
  533.             if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then
  534.                 v:destroy()
  535.             end
  536.         end
  537.         for i,v in pairs(character:GetChildren()) do
  538.             if v.ClassName == "Accessory" then
  539.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  540.                 if attachment1 then
  541.                     for q,w in pairs(character:GetChildren()) do
  542.                         if w.ClassName == "Part" then
  543.                             local attachment2 = w:findFirstChild(attachment1.Name)
  544.                             if attachment2 then
  545.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  546.                                 hinge.Attachment0 = attachment1
  547.                                 hinge.Attachment1 = attachment2
  548.                                 hinge.LimitsEnabled = true
  549.                                 hinge.LowerAngle = 0
  550.                                 hinge.UpperAngle = 0
  551.                             end
  552.                         end
  553.                     end
  554.                 end
  555.             end
  556.         end
  557.         ragdoll.Parent = workspace
  558.         if ragdoll:findFirstChild("Right Arm") then
  559.             local glue = Instance.new("Glue", ragdoll.Torso)
  560.             glue.Part0 = ragdoll.Torso
  561.             glue.Part1 = ragdoll:findFirstChild("Right Arm")
  562.             glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  563.             glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  564.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
  565.             limbcollider.Size = Vector3.new(1.4,1,1)
  566.             limbcollider.Shape = "Cylinder"
  567.             limbcollider.Transparency = 1
  568.             limbcollider.Name = "LimbCollider"
  569.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  570.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
  571.             limbcolliderweld.Part1 = limbcollider
  572.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  573.         end
  574.         if ragdoll:findFirstChild("Left Arm") then
  575.             local glue = Instance.new("Glue", ragdoll.Torso)
  576.             glue.Part0 = ragdoll.Torso
  577.             glue.Part1 = ragdoll:findFirstChild("Left Arm")
  578.             glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  579.             glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  580.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
  581.             limbcollider.Size = Vector3.new(1.4,1,1)
  582.             limbcollider.Shape = "Cylinder"
  583.             limbcollider.Name = "LimbCollider"
  584.             limbcollider.Transparency = 1
  585.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  586.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
  587.             limbcolliderweld.Part1 = limbcollider
  588.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  589.         end
  590.         if ragdoll:findFirstChild("Left Leg") then
  591.             local glue = Instance.new("Glue", ragdoll.Torso)
  592.             glue.Part0 = ragdoll.Torso
  593.             glue.Part1 = ragdoll:findFirstChild("Left Leg")
  594.             glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  595.             glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  596.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
  597.             limbcollider.Size = Vector3.new(1.4,1,1)
  598.             limbcollider.Shape = "Cylinder"
  599.             limbcollider.Name = "LimbCollider"
  600.             limbcollider.Transparency = 1
  601.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  602.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
  603.             limbcolliderweld.Part1 = limbcollider
  604.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  605.         end
  606.         if ragdoll:findFirstChild("Right Leg") then
  607.             local glue = Instance.new("Glue", ragdoll.Torso)
  608.             glue.Part0 = ragdoll.Torso
  609.             glue.Part1 = ragdoll:findFirstChild("Right Leg")
  610.             glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  611.             glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  612.             local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
  613.             limbcollider.Size = Vector3.new(1.4,1,1)
  614.             limbcollider.Shape = "Cylinder"
  615.             limbcollider.Name = "LimbCollider"
  616.             limbcollider.Transparency = 1
  617.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  618.             limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
  619.             limbcolliderweld.Part1 = limbcollider
  620.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  621.         end
  622.         if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then
  623.             local HeadAttachment = Instance.new("Attachment", ragdoll["Head"])
  624.             HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  625.             local connection = Instance.new('HingeConstraint', ragdoll["Head"])
  626.             connection.LimitsEnabled = true
  627.             connection.Attachment0 = ragdoll.Torso.NeckAttachment
  628.             connection.Attachment1 = HeadAttachment
  629.             connection.UpperAngle = 60
  630.             connection.LowerAngle = -60
  631.         elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then
  632.             local hedweld = Instance.new("Weld", ragdoll.Torso)
  633.             hedweld.Part0 = ragdoll.Torso
  634.             hedweld.Part1 = ragdoll.Head
  635.             hedweld.C0 = CFrame.new(0,1.5,0)
  636.         end
  637.         game.Debris:AddItem(ragdoll, 30)
  638.         local function aaaalol()
  639.             wait(0.2)
  640.             local function searchforvelocity(wot)
  641.                 for i,v in pairs(wot:GetChildren()) do
  642.                     searchforvelocity(v)
  643.                     if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
  644.                         v:destroy()
  645.                     end
  646.                 end
  647.             end
  648.             searchforvelocity(ragdoll)
  649.             wait(0.5)
  650.             if ragdoll:findFirstChildOfClass("Humanoid") then
  651.                 ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
  652.             end
  653.             if ragdoll:findFirstChild("HumanoidRootPart") then
  654.                 ragdoll:findFirstChild("HumanoidRootPart"):destroy()
  655.             end
  656.         end
  657.         spawn(aaaalol)
  658.     elseif character:findFirstChild("UpperTorso") then
  659.         character.Archivable = true
  660.         for i,v in pairs(character:GetChildren()) do
  661.             if v.ClassName == "Sound" then
  662.                 v:remove()
  663.             end
  664.             for q,w in pairs(v:GetChildren()) do
  665.                 if w.ClassName == "Sound" then
  666.                     w:remove()
  667.                 end
  668.             end
  669.         end
  670.         local ragdoll = character:Clone()
  671.         ragdoll:findFirstChildOfClass("Humanoid").Health = 0
  672.         if ragdoll:findFirstChild("Health") then
  673.             if ragdoll:findFirstChild("Health").ClassName == "Script" then
  674.                 ragdoll:findFirstChild("Health").Disabled = true
  675.             end
  676.         end
  677.         for i,v in pairs(character:GetChildren()) do
  678.             if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then
  679.                 v:destroy()
  680.             end
  681.         end
  682.         for i,v in pairs(character:GetChildren()) do
  683.             if v.ClassName == "Accessory" then
  684.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  685.                 if attachment1 then
  686.                     for q,w in pairs(character:GetChildren()) do
  687.                         if w.ClassName == "Part" or w.ClassName == "MeshPart" then
  688.                             local attachment2 = w:findFirstChild(attachment1.Name)
  689.                             if attachment2 then
  690.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  691.                                 hinge.Attachment0 = attachment1
  692.                                 hinge.Attachment1 = attachment2
  693.                                 hinge.LimitsEnabled = true
  694.                                 hinge.LowerAngle = 0
  695.                                 hinge.UpperAngle = 0
  696.                             end
  697.                         end
  698.                     end
  699.                 end
  700.             end
  701.         end
  702.         ragdoll.Parent = workspace
  703.         local Humanoid = ragdoll:findFirstChildOfClass("Humanoid")
  704.         Humanoid.PlatformStand = true
  705.         local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper)
  706.             local connection = Instance.new('BallSocketConstraint', limb)
  707.             connection.LimitsEnabled = true
  708.             connection.Attachment0 = attachementone
  709.             connection.Attachment1 = attachmenttwo
  710.             connection.TwistLimitsEnabled = true
  711.             connection.TwistLowerAngle = twistlower
  712.             connection.TwistUpperAngle = twistupper
  713.             local limbcollider = Instance.new("Part", limb)
  714.             limbcollider.Size = Vector3.new(0.1,1,1)
  715.             limbcollider.Shape = "Cylinder"
  716.             limbcollider.Transparency = 1
  717.             limbcollider:BreakJoints()
  718.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  719.             limbcolliderweld.Part0 = limb
  720.             limbcolliderweld.Part1 = limbcollider
  721.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
  722.         end
  723.         local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper)
  724.             local connection = Instance.new('HingeConstraint', limb)
  725.             connection.LimitsEnabled = true
  726.             connection.Attachment0 = attachementone
  727.             connection.Attachment1 = attachmenttwo
  728.             connection.LimitsEnabled = true
  729.             connection.LowerAngle = lower
  730.             connection.UpperAngle = upper
  731.             local limbcollider = Instance.new("Part", limb)
  732.             limbcollider.Size = Vector3.new(0.1,1,1)
  733.             limbcollider.Shape = "Cylinder"
  734.             limbcollider.Transparency = 1
  735.             limbcollider:BreakJoints()
  736.             local limbcolliderweld = Instance.new("Weld", limbcollider)
  737.             limbcolliderweld.Part0 = limb
  738.             limbcolliderweld.Part1 = limbcollider
  739.             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2)
  740.         end
  741.         local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
  742.         HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  743.         if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then
  744.             makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50)
  745.         end
  746.         makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50)
  747.         makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180)
  748.         makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60)
  749.         makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20)
  750.         --
  751.         makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180)
  752.         makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60)
  753.         makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20)
  754.         --
  755.         makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80)
  756.         makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60)
  757.         makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20)
  758.         --
  759.         makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80)
  760.         makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60)
  761.         makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20)
  762.         for i,v in pairs(Humanoid.Parent:GetChildren()) do
  763.             if v.ClassName == "Accessory" then
  764.                 local attachment1 = v.Handle:findFirstChildOfClass("Attachment")
  765.                 if attachment1 then
  766.                     for q,w in pairs(Humanoid.Parent:GetChildren()) do
  767.                         if w.ClassName == "Part" then
  768.                             local attachment2 = w:findFirstChild(attachment1.Name)
  769.                             if attachment2 then
  770.                                 local hinge = Instance.new("HingeConstraint", v.Handle)
  771.                                 hinge.Attachment0 = attachment1
  772.                                 hinge.Attachment1 = attachment2
  773.                                 hinge.LimitsEnabled = true
  774.                                 hinge.LowerAngle = 0
  775.                                 hinge.UpperAngle = 0
  776.                             end
  777.                         end
  778.                     end
  779.                 end
  780.             end
  781.         end
  782.         for i,v in pairs(ragdoll:GetChildren()) do
  783.             for q,w in pairs(v:GetChildren()) do
  784.                 if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] then
  785.                     w:destroy()
  786.                 end
  787.             end
  788.         end
  789.         if ragdoll:findFirstChild("HumanoidRootPart") then
  790.             ragdoll.HumanoidRootPart.Anchored = true
  791.             ragdoll.HumanoidRootPart.CanCollide = false
  792.         end
  793.         if ragdoll:findFirstChildOfClass("Humanoid") then
  794.             ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true
  795.         end
  796.         local function waitfordatmoment()
  797.             wait(0.2)
  798.             local function searchforvelocity(wot)
  799.                 for i,v in pairs(wot:GetChildren()) do
  800.                     searchforvelocity(v)
  801.                     if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then
  802.                         v:destroy()
  803.                     end
  804.                 end
  805.             end
  806.             searchforvelocity(ragdoll)
  807.         end
  808.         spawn(waitfordatmoment)
  809.         game.Debris:AddItem(ragdoll, 30)
  810.     end
  811. end
Add Comment
Please, Sign In to add comment