Advertisement
Robloxlover12445

Explode tool >:D

Oct 21st, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1.  
  2.  
  3. LocalPlayer = Game:GetService("Players")["LocalPlayer"]
  4. Maximum_Damage = 1000
  5. Blast_Radius = 10
  6.  
  7. if not script["Parent"]:IsA("HopperBin") then
  8. HopperBin = Instance.new("HopperBin", LocalPlayer:FindFirstChild("Backpack"))
  9. HopperBin["Name"] = "Smite"
  10. script["Parent"] = HopperBin
  11. end
  12.  
  13. function Click(Mouse)
  14. if Mouse["Hit"] == nil then return end
  15. local Explosion = Instance.new("Explosion", Workspace)
  16. Explosion["BlastPressure"] = math.huge
  17. Explosion["BlastRadius"] = Blast_Radius
  18. Explosion["Position"] = Mouse["Hit"]["p"]
  19. Explosion["Hit"]:connect(function (Part, Distance)
  20. local Humanoid = Part["Parent"]:FindFirstChild("Humanoid")
  21. if Humanoid and Part["Parent"]["Name"] ~= LocalPlayer["Name"] then
  22. local Distance_Factor = Distance/Blast_Radius
  23. Distance_Factor = 1 - Distance_Factor
  24. Humanoid:TakeDamage(Maximum_Damage * Distance_Factor)
  25. end
  26. end)
  27. end
  28.  
  29. function Selected(Mouse)
  30. Mouse["Button1Down"]:connect(function () Click(Mouse) end)
  31. end
  32.  
  33. script["Parent"]["Selected"]:connect(Selected)
  34.  
  35. ---------------------
  36. --BodyGyro Rotation--
  37. ---------------------
  38.  
  39. LocalPlayer = Game:GetService("Players").LocalPlayer
  40. Backpack = LocalPlayer:FindFirstChild("Backpack")
  41. Character = LocalPlayer.Character
  42. Torso = Character:FindFirstChild("Torso")
  43.  
  44. if not script.Parent:IsA("HopperBin") then
  45. HopperBin = Instance.new("HopperBin", Backpack)
  46. HopperBin.Name = "Rotate"
  47. script.Parent = HopperBin
  48. end
  49.  
  50. Selected = false
  51.  
  52. function Selected(Mouse)
  53. Selected = true
  54. for _, Object in pairs(Torso:GetChildren()) do
  55. if Object:IsA("BodyGyro") or Object:IsA("BodyVelocity") then
  56. Object:Destroy()
  57. end
  58. end
  59. local BodyGyro = Instance.new("BodyGyro", Torso)
  60. BodyGyro.Name = "BodyGyro"
  61. BodyGyro.P = 10000
  62. BodyGyro.D = 1000
  63. BodyGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  64. BodyGyro.cframe = CFrame.new(Mouse.Hit.p.X, Torso.CFrame.Y, Mouse.Hit.p.Z)
  65. while Selected == true do
  66. wait()
  67. BodyGyro.cframe = CFrame.new(Mouse.Hit.p.X, Torso.CFrame.Y, Mouse.Hit.p.Z)
  68. end
  69. end
  70.  
  71. function Deselected(Mouse)
  72. Selected = false
  73. for _, Object in pairs(Torso:GetChildren()) do
  74. if Object:IsA("BodyGyro") or Object:IsA("BodyVelocity") then
  75. Object:Destroy()
  76. end
  77. end
  78. end
  79.  
  80. script.Parent.Selected:connect(Selected)
  81. script.Parent.Deselected:connect(Deselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement