Advertisement
ImpulseYT

Untitled

Apr 9th, 2021
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  1. local active = true
  2. local trueActive = true
  3. local reachType = "Sphere"
  4. local dmgEnabled = true
  5. local visualizerEnabled = false
  6.  
  7. local visualizer = Instance.new("Part")
  8. visualizer.BrickColor = BrickColor.Blue()
  9. visualizer.Transparency = 0.6
  10. visualizer.Anchored = true
  11. visualizer.CanCollide = false
  12. visualizer.Size = Vector3.new(0.5,0.5,0.5)
  13. visualizer.BottomSurface = Enum.SurfaceType.Smooth
  14. visualizer.TopSurface = Enum.SurfaceType.Smooth
  15.  
  16. local ScreenGui = Instance.new("ScreenGui")
  17. local Frame = Instance.new("Frame")
  18. local TextLabel = Instance.new("TextLabel")
  19. local TextBox = Instance.new("TextBox")
  20. local TextLabel_2 = Instance.new("TextLabel")
  21. local TextLabel_3 = Instance.new("TextLabel")
  22. local TextLabel_4 = Instance.new("TextLabel")
  23. local TextButton = Instance.new("TextButton")
  24. local Frame_2 = Instance.new("Frame")
  25. local Frame_3 = Instance.new("Frame")
  26. local Frame_4 = Instance.new("Frame")
  27. local Frame_5 = Instance.new("Frame")
  28. local TextButton_2 = Instance.new("TextButton")
  29.  
  30. --Properties:
  31.  
  32. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  33. ScreenGui.DisplayOrder = 999999999
  34. ScreenGui.ResetOnSpawn = false
  35.  
  36. Frame.Parent = ScreenGui
  37. Frame.AnchorPoint = Vector2.new(0, 0.5)
  38. Frame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  39. Frame.BackgroundTransparency = 0.300
  40. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  41. Frame.BorderSizePixel = 4
  42. Frame.Position = UDim2.new(0, 0, 0.600000024, 0)
  43. Frame.Size = UDim2.new(0.150000006, 0, 0.300000012, 0)
  44.  
  45. TextLabel.Parent = Frame
  46. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  47. TextLabel.BackgroundTransparency = 1.000
  48. TextLabel.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  49. TextLabel.Font = Enum.Font.SourceSans
  50. TextLabel.Text = "Reach:"
  51. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  52. TextLabel.TextScaled = true
  53. TextLabel.TextSize = 14.000
  54. TextLabel.TextWrapped = true
  55.  
  56. TextBox.Parent = Frame
  57. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  58. TextBox.BackgroundTransparency = 1.000
  59. TextBox.Position = UDim2.new(0.600000024, 0, 0, 0)
  60. TextBox.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
  61. TextBox.Font = Enum.Font.SourceSans
  62. TextBox.Text = "3.5"
  63. TextBox.TextColor3 = Color3.fromRGB(255, 76, 76)
  64. TextBox.TextScaled = true
  65. TextBox.TextSize = 14.000
  66. TextBox.TextWrapped = true
  67.  
  68. TextLabel_2.Parent = Frame
  69. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  70. TextLabel_2.BackgroundTransparency = 1.000
  71. TextLabel_2.Position = UDim2.new(0, 0, 0.200000003, 0)
  72. TextLabel_2.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  73. TextLabel_2.Font = Enum.Font.SourceSans
  74. TextLabel_2.Text = "Shape:"
  75. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  76. TextLabel_2.TextScaled = true
  77. TextLabel_2.TextSize = 14.000
  78. TextLabel_2.TextWrapped = true
  79.  
  80. TextLabel_3.Parent = Frame
  81. TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  82. TextLabel_3.BackgroundTransparency = 1.000
  83. TextLabel_3.Position = UDim2.new(0, 0, 0.400000006, 0)
  84. TextLabel_3.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  85. TextLabel_3.Font = Enum.Font.SourceSans
  86. TextLabel_3.Text = "Damage:"
  87. TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
  88. TextLabel_3.TextScaled = true
  89. TextLabel_3.TextSize = 14.000
  90. TextLabel_3.TextWrapped = true
  91.  
  92. TextLabel_4.Parent = Frame
  93. TextLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  94. TextLabel_4.BackgroundTransparency = 1.000
  95. TextLabel_4.Position = UDim2.new(0, 0, 0.600000024, 0)
  96. TextLabel_4.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  97. TextLabel_4.Font = Enum.Font.SourceSans
  98. TextLabel_4.Text = "Visualizer:"
  99. TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
  100. TextLabel_4.TextScaled = true
  101. TextLabel_4.TextSize = 14.000
  102. TextLabel_4.TextWrapped = true
  103.  
  104. TextButton.Parent = Frame
  105. TextButton.AnchorPoint = Vector2.new(0, 1)
  106. TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  107. TextButton.BackgroundTransparency = 1.000
  108. TextButton.Position = UDim2.new(0, 0, 1, 0)
  109. TextButton.Size = UDim2.new(1, 0, 0.150000006, 0)
  110. TextButton.Font = Enum.Font.SourceSansBold
  111. TextButton.Text = "Impulse reach"
  112. TextButton.TextColor3 = Color3.fromRGB(222, 0, 0)
  113. TextButton.TextScaled = true
  114. TextButton.TextSize = 14.000
  115. TextButton.TextWrapped = true
  116.  
  117. Frame_2.Parent = Frame
  118. Frame_2.Active = true
  119. Frame_2.AnchorPoint = Vector2.new(0, 0.5)
  120. Frame_2.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  121. Frame_2.BorderSizePixel = 0
  122. Frame_2.Position = UDim2.new(0.725000024, 0, 0.699999988, 0)
  123. Frame_2.Size = UDim2.new(0, 25, 0, 25)
  124. Frame_2.ZIndex = 5
  125.  
  126. Frame_3.Parent = Frame_2
  127. Frame_3.AnchorPoint = Vector2.new(0.5, 0.5)
  128. Frame_3.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
  129. Frame_3.BorderSizePixel = 0
  130. Frame_3.LayoutOrder = 1
  131. Frame_3.Position = UDim2.new(0.5, 0, 0.5, 0)
  132.  
  133. Frame_4.Parent = Frame
  134. Frame_4.Active = true
  135. Frame_4.AnchorPoint = Vector2.new(0, 0.5)
  136. Frame_4.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  137. Frame_4.BorderSizePixel = 0
  138. Frame_4.Position = UDim2.new(0.725000024, 0, 0.5, 0)
  139. Frame_4.Size = UDim2.new(0, 25, 0, 25)
  140. Frame_4.ZIndex = 5
  141.  
  142. Frame_5.Parent = Frame_4
  143. Frame_5.AnchorPoint = Vector2.new(0.5, 0.5)
  144. Frame_5.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
  145. Frame_5.BorderSizePixel = 0
  146. Frame_5.LayoutOrder = 1
  147. Frame_5.Position = UDim2.new(0.5, 0, 0.5, 0)
  148. Frame_5.Size = UDim2.new(1, 0, 1, 0)
  149.  
  150. TextButton_2.Parent = Frame
  151. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  152. TextButton_2.BackgroundTransparency = 1.000
  153. TextButton_2.Position = UDim2.new(0.600000024, 0, 0.200000003, 0)
  154. TextButton_2.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
  155. TextButton_2.Font = Enum.Font.SourceSans
  156. TextButton_2.Text = "Sphere"
  157. TextButton_2.TextColor3 = Color3.fromRGB(255, 76, 76)
  158. TextButton_2.TextScaled = true
  159. TextButton_2.TextSize = 14.000
  160. TextButton_2.TextWrapped = true
  161.  
  162. repeat wait() until game.Players.LocalPlayer
  163. ScreenGui.Parent = game:GetService("CoreGui")
  164.  
  165.  
  166.  
  167.  
  168. Frame_4.InputBegan:connect(function(inp)
  169.     if inp.UserInputType == Enum.UserInputType.MouseButton1 then
  170.         dmgEnabled = not dmgEnabled
  171.         local goal = {Size = UDim2.new(0,0,0,0)}
  172.         if dmgEnabled then
  173.             goal = {Size = UDim2.new(1,0,1,0)}
  174.         end
  175.         game:GetService("TweenService"):Create(Frame_5,TweenInfo.new(0.12,Enum.EasingStyle.Quad),goal):Play()
  176.     end
  177. end)
  178. Frame_2.InputBegan:connect(function(inp)
  179.     if inp.UserInputType == Enum.UserInputType.MouseButton1 then
  180.         visualizerEnabled = not visualizerEnabled
  181.         local goal = {Size = UDim2.new(0,0,0,0)}
  182.         if visualizerEnabled then
  183.             goal = {Size = UDim2.new(1,0,1,0)}
  184.         end
  185.         game:GetService("TweenService"):Create(Frame_3,TweenInfo.new(0.12,Enum.EasingStyle.Linear),goal):Play()
  186.     end
  187. end)
  188. TextButton_2.MouseButton1Click:connect(function()
  189.     if reachType == "Sphere" then
  190.         reachType = "Line"
  191.     else
  192.         reachType = "Sphere"
  193.     end
  194.     TextButton_2.Text = reachType
  195. end)
  196. TextButton.MouseButton1Click:connect(function()
  197.     trueActive = false
  198.     ScreenGui:Destroy()
  199. end)
  200. game:GetService("UserInputService").InputBegan:connect(function(inp,gpe)
  201.     if gpe then return end
  202.     if inp.KeyCode == Enum.KeyCode.H then
  203.         ScreenGui.Enabled = not ScreenGui.Enabled
  204.     end
  205. end)
  206.  
  207. local plr = game.Players.LocalPlayer
  208.  
  209. local function onHit(hit,handle)
  210.     local victim = hit.Parent:FindFirstChildOfClass("Humanoid")
  211.         if victim and victim.Parent.Name ~= game.Players.LocalPlayer.Name then
  212.         if dmgEnabled then
  213.             for _,v in pairs(hit.Parent:GetChildren()) do
  214.                 if v:IsA("Part") then
  215.                     firetouchinterest(v,handle,0)
  216.                     firetouchinterest(v,handle,1)
  217.                 end
  218.             end
  219.         else
  220.             firetouchinterest(hit,handle,0)
  221.             firetouchinterest(hit,handle,1)
  222.         end
  223.     end
  224. end
  225.  
  226. local function getWhiteList()
  227.     local wl = {}
  228.     for _,v in pairs(game.Players:GetPlayers()) do
  229.         if v ~= plr then
  230.             local char = v.Character
  231.             if char then
  232.                 for _,q in pairs(char:GetChildren()) do
  233.                     if q:IsA("Part") then
  234.                         table.insert(wl,q)
  235.                     end
  236.                 end
  237.             end
  238.         end
  239.     end
  240.     return wl
  241. end
  242.  
  243. game:GetService("RunService").RenderStepped:connect(function()
  244.     if not active or not trueActive then return end
  245.     local s = plr.Character and plr.Character:FindFirstChildOfClass("Tool")
  246.     if not s then visualizer.Parent = nil end
  247.     if s then
  248.         local handle = s:FindFirstChild("Handle") or s:FindFirstChildOfClass("Part")
  249.         if handle then
  250.             if visualizerEnabled then
  251.                 visualizer.Parent = workspace
  252.             else
  253.                 visualizer.Parent = nil
  254.             end
  255.             local reach = tonumber(TextBox.Text)
  256.             if reach then
  257.                 if reachType == "Sphere" then
  258.                     visualizer.Shape = Enum.PartType.Ball
  259.                     visualizer.Size = Vector3.new(reach,reach,reach)
  260.                     visualizer.CFrame = handle.CFrame
  261.                     for _,v in pairs(game.Players:GetPlayers()) do
  262.                         local hrp = v.Character and v.Character:FindFirstChild("HumanoidRootPart")
  263.                         if hrp and handle then
  264.                             local mag = (hrp.Position-handle.Position).magnitude
  265.                             if mag <= reach then
  266.                                 onHit(hrp,handle)
  267.                             end
  268.                         end
  269.                     end
  270.                 elseif reachType == "Line" then
  271.                     local origin = (handle.CFrame*CFrame.new(0,0,-2)).p
  272.                     local ray = Ray.new(origin,handle.CFrame.lookVector*-reach)
  273.                     local p,pos = workspace:FindPartOnRayWithWhitelist(ray,getWhiteList())
  274.                     visualizer.Shape = Enum.PartType.Block
  275.                     visualizer.Size = Vector3.new(1,0.8,reach)
  276.                     visualizer.CFrame = handle.CFrame*CFrame.new(0,0,(reach/2)+2)
  277.                     if p then
  278.                         onHit(p,handle)
  279.                     else
  280.                         for _,v in pairs(handle:GetTouchingParts()) do
  281.                             onHit(v,handle)
  282.                         end
  283.                     end
  284.                 end
  285.             end
  286.         end
  287.     end
  288. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement