Advertisement
Killanotkillz

Reach Script

Feb 21st, 2025 (edited)
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.72 KB | None | 0 0
  1. getgenv().AutoReport = true
  2. local active = true
  3. local trueActive = true
  4. local reachType = "Sphere"
  5. local dmgEnabled = true
  6. local visualizerEnabled = false
  7.  
  8. local visualizer = Instance.new("Part")
  9. visualizer.BrickColor = BrickColor.Blue()
  10. visualizer.Transparency = 0.6
  11. visualizer.Anchored = true
  12. visualizer.CanCollide = false
  13. visualizer.Size = Vector3.new(0.5,0.5,0.5)
  14. visualizer.BottomSurface = Enum.SurfaceType.Smooth
  15. visualizer.TopSurface = Enum.SurfaceType.Smooth
  16.  
  17. local ScreenGui = Instance.new("ScreenGui")
  18. local Frame = Instance.new("Frame")
  19. local TextLabel = Instance.new("TextLabel")
  20. local TextBox = Instance.new("TextBox")
  21. local TextLabel_2 = Instance.new("TextLabel")
  22. local TextLabel_3 = Instance.new("TextLabel")
  23. local TextLabel_4 = Instance.new("TextLabel")
  24. local TextButton = Instance.new("TextButton")
  25. local Frame_2 = Instance.new("Frame")
  26. local Frame_3 = Instance.new("Frame")
  27. local Frame_4 = Instance.new("Frame")
  28. local Frame_5 = Instance.new("Frame")
  29. local TextButton_2 = Instance.new("TextButton")
  30.  
  31. --Properties:
  32.  
  33. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  34. ScreenGui.DisplayOrder = 999999999
  35. ScreenGui.ResetOnSpawn = false
  36.  
  37. Frame.Parent = ScreenGui
  38. Frame.AnchorPoint = Vector2.new(0, 0.5)
  39. Frame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  40. Frame.BackgroundTransparency = 0.300
  41. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  42. Frame.BorderSizePixel = 4
  43. Frame.Position = UDim2.new(0, 0, 0.600000024, 0)
  44. Frame.Size = UDim2.new(0.150000006, 0, 0.300000012, 0)
  45.  
  46. TextLabel.Parent = Frame
  47. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  48. TextLabel.BackgroundTransparency = 1.000
  49. TextLabel.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  50. TextLabel.Font = Enum.Font.SourceSans
  51. TextLabel.Text = "Reach:"
  52. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  53. TextLabel.TextScaled = true
  54. TextLabel.TextSize = 14.000
  55. TextLabel.TextWrapped = true
  56.  
  57. TextBox.Parent = Frame
  58. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  59. TextBox.BackgroundTransparency = 1.000
  60. TextBox.Position = UDim2.new(0.600000024, 0, 0, 0)
  61. TextBox.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
  62. TextBox.Font = Enum.Font.SourceSans
  63. TextBox.Text = "3.5"
  64. TextBox.TextColor3 = Color3.fromRGB(255, 76, 76)
  65. TextBox.TextScaled = true
  66. TextBox.TextSize = 14.000
  67. TextBox.TextWrapped = true
  68.  
  69. TextLabel_2.Parent = Frame
  70. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  71. TextLabel_2.BackgroundTransparency = 1.000
  72. TextLabel_2.Position = UDim2.new(0, 0, 0.200000003, 0)
  73. TextLabel_2.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  74. TextLabel_2.Font = Enum.Font.SourceSans
  75. TextLabel_2.Text = "Shape:"
  76. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  77. TextLabel_2.TextScaled = true
  78. TextLabel_2.TextSize = 14.000
  79. TextLabel_2.TextWrapped = true
  80.  
  81. TextLabel_3.Parent = Frame
  82. TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  83. TextLabel_3.BackgroundTransparency = 1.000
  84. TextLabel_3.Position = UDim2.new(0, 0, 0.400000006, 0)
  85. TextLabel_3.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  86. TextLabel_3.Font = Enum.Font.SourceSans
  87. TextLabel_3.Text = "Damage:"
  88. TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
  89. TextLabel_3.TextScaled = true
  90. TextLabel_3.TextSize = 14.000
  91. TextLabel_3.TextWrapped = true
  92.  
  93. TextLabel_4.Parent = Frame
  94. TextLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  95. TextLabel_4.BackgroundTransparency = 1.000
  96. TextLabel_4.Position = UDim2.new(0, 0, 0.600000024, 0)
  97. TextLabel_4.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
  98. TextLabel_4.Font = Enum.Font.SourceSans
  99. TextLabel_4.Text = "Visualizer:"
  100. TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
  101. TextLabel_4.TextScaled = true
  102. TextLabel_4.TextSize = 14.000
  103. TextLabel_4.TextWrapped = true
  104.  
  105. TextButton.Parent = Frame
  106. TextButton.AnchorPoint = Vector2.new(0, 1)
  107. TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  108. TextButton.BackgroundTransparency = 1.000
  109. TextButton.Position = UDim2.new(0, 0, 1, 0)
  110. TextButton.Size = UDim2.new(1, 0, 0.150000006, 0)
  111. TextButton.Font = Enum.Font.SourceSansBold
  112. TextButton.Text = "Kill Script"
  113. TextButton.TextColor3 = Color3.fromRGB(222, 0, 0)
  114. TextButton.TextScaled = true
  115. TextButton.TextSize = 14.000
  116. TextButton.TextWrapped = true
  117.  
  118. Frame_2.Parent = Frame
  119. Frame_2.Active = true
  120. Frame_2.AnchorPoint = Vector2.new(0, 0.5)
  121. Frame_2.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  122. Frame_2.BorderSizePixel = 0
  123. Frame_2.Position = UDim2.new(0.725000024, 0, 0.699999988, 0)
  124. Frame_2.Size = UDim2.new(0, 25, 0, 25)
  125. Frame_2.ZIndex = 5
  126.  
  127. Frame_3.Parent = Frame_2
  128. Frame_3.AnchorPoint = Vector2.new(0.5, 0.5)
  129. Frame_3.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
  130. Frame_3.BorderSizePixel = 0
  131. Frame_3.LayoutOrder = 1
  132. Frame_3.Position = UDim2.new(0.5, 0, 0.5, 0)
  133.  
  134. Frame_4.Parent = Frame
  135. Frame_4.Active = true
  136. Frame_4.AnchorPoint = Vector2.new(0, 0.5)
  137. Frame_4.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  138. Frame_4.BorderSizePixel = 0
  139. Frame_4.Position = UDim2.new(0.725000024, 0, 0.5, 0)
  140. Frame_4.Size = UDim2.new(0, 25, 0, 25)
  141. Frame_4.ZIndex = 5
  142.  
  143. Frame_5.Parent = Frame_4
  144. Frame_5.AnchorPoint = Vector2.new(0.5, 0.5)
  145. Frame_5.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
  146. Frame_5.BorderSizePixel = 0
  147. Frame_5.LayoutOrder = 1
  148. Frame_5.Position = UDim2.new(0.5, 0, 0.5, 0)
  149. Frame_5.Size = UDim2.new(1, 0, 1, 0)
  150.  
  151. TextButton_2.Parent = Frame
  152. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  153. TextButton_2.BackgroundTransparency = 1.000
  154. TextButton_2.Position = UDim2.new(0.600000024, 0, 0.200000003, 0)
  155. TextButton_2.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
  156. TextButton_2.Font = Enum.Font.SourceSans
  157. TextButton_2.Text = "Sphere"
  158. TextButton_2.TextColor3 = Color3.fromRGB(255, 76, 76)
  159. TextButton_2.TextScaled = true
  160. TextButton_2.TextSize = 14.000
  161. TextButton_2.TextWrapped = true
  162.  
  163. repeat wait() until game.Players.LocalPlayer
  164. ScreenGui.Parent = game:GetService("CoreGui")
  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