Advertisement
eruaaaaaaa

f

May 4th, 2022 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.27 KB | None | 0 0
  1. local Aimbot = {}
  2. Aimbot.__index = Aimbot
  3.  
  4. --//Localization
  5. local Instance = Instance
  6. local game = game
  7. local math = math
  8. local setmetatable = setmetatable
  9. local workspace = workspace
  10. local CFrame = CFrame
  11. local Vector3 = Vector3
  12. local Vector2 = Vector2
  13. local Random = Random
  14. local RaycastParams = RaycastParams
  15. local pairs = pairs
  16. local string = string
  17. local table = table
  18. local Enum = Enum
  19. local getrawmetatable = getrawmetatable
  20. local replaceclosure = replaceclosure
  21. local setreadonly = setreadonly
  22. local checkcaller = checkcaller
  23. local getclock = os.clock
  24. local mouse1press = mouse1press
  25. local mouse1release = mouse1release
  26. local mousemoverel = mousemoverel
  27. local hookfunction = hookfunction
  28. local newcclosure = newcclosure
  29.  
  30. --//Instance methods
  31. local Raycast = workspace.Raycast
  32. local GetPropertyChangedSignal = game.GetPropertyChangedSignal
  33. local Connect = game.ChildAdded.Connect
  34. local Destroy = game.Destroy
  35. local GetService = game.GetService
  36. local FindFirstChildOfClass = game.FindFirstChildOfClass
  37. local FindFirstChild = game.FindFirstChild
  38. local GetChildren = game.GetChildren
  39. local IsA = game.IsA
  40. local IsDescendantOf = game.IsDescendantOf
  41.  
  42. --//Services
  43. local Players = GetService(game, "Players")
  44. local UserInputService = GetService(game, "UserInputService")
  45. local RunService = GetService(game, "RunService")
  46. local GuiService = GetService(game, "GuiService")
  47.  
  48. --//Temporary instances
  49. local tempcam = Instance.new("Camera")
  50. local tempconn = Connect(game.AncestryChanged, function() end)
  51.  
  52. --//Other instance methods
  53. local WorldToViewportPoint = tempcam.WorldToViewportPoint
  54. local WorldToScreenPoint = tempcam.WorldToScreenPoint
  55. local GetPlayers = Players.GetPlayers
  56. local GetMouseLocation = UserInputService.GetMouseLocation
  57. local ViewportPointToRay = tempcam.ViewportPointToRay
  58. local Disconnect = tempconn.Disconnect
  59. local Lerp2D = Vector2.new().Lerp
  60.  
  61. --//Cleanup
  62. Destroy(tempcam)
  63. Disconnect(tempconn)
  64.  
  65. --//Local functions and constant variables
  66. Aimbot.DefaultSettings = {
  67. RadiusPercentAt1 = 130, --//Radius percent of screen width at 1 stud for aimbot
  68. XSmoothingPercent = .125,
  69. YSmoothingPercent = .15, --//Slows down mouse movement by a percentage of screen width
  70. DistanceBias = 1, --//Raises sensitivity of distance from camera when choosing target
  71. Offset = Vector2.new(0, 0), --//Mouse offset in pixels
  72. SilentRadiusPercentAt1 = 130, --//Radius percent of screen width at 1 stud for silent aim
  73. IgnoreTransparent = true, --//Whether to ignore transparent parts above the threshold or not in wallcheck
  74. IgnoreWater = false, --//Whether to ignore water in wallcheck
  75. TransparencyThreshold = .5, --//Threshold for what transparency or greater counts as ignorable
  76. DefaultIgnore = {}, --//List for what the aimbot should ignore during wallcheck
  77. IsAliveCheck = true, --//Ignore dead players
  78. TeamCheck = true,
  79. TriggerBot = true,
  80. InvisibleCheck = true,
  81. TriggerBotTime = 160,
  82. TriggerBotSemi = false,
  83. TriggerBotTimeBetweenClick = .3,
  84. HoldControl = false,
  85. Holding = false,
  86. SizeCheck = false,
  87. FlickSettings = {
  88. FlickXSmoothingPercent = .9, -- .6
  89. FlickYSmoothingPercent = .9, -- .6
  90. Flick = true -- false if only will track
  91. },
  92. AutoPeak = {
  93. Enabled = false,
  94. PointPosition = nil -- dont chage this
  95. },
  96. RadiusCap = nil
  97. }
  98.  
  99. local LocalPlayer = Players.LocalPlayer
  100. local Mouse = LocalPlayer.GetMouse(LocalPlayer)
  101. local GuiInset = GuiService.GetGuiInset(GuiService)
  102. local GameMeta = getrawmetatable(game)
  103.  
  104. local function OnCameraChange()
  105. local cam = workspace.CurrentCamera
  106.  
  107. Aimbot.Camera = cam
  108. Aimbot.ViewportSize = cam.ViewportSize
  109. Aimbot.WidthFactor = cam.ViewportSize.X / 100
  110. end
  111.  
  112. local function UpdateTable(tab, update)
  113. for name, value in pairs(update) do
  114. if tab[name] == nil then
  115. tab[name] = value
  116. end
  117. end
  118. end
  119.  
  120. local function GetChildrenWhichIsA(part, baseclass)
  121. local parts = GetChildren(part)
  122. local len = #parts
  123.  
  124. local filtered = {}
  125.  
  126. if len > 0 then
  127. for i = 1, len do
  128. local p = parts[i]
  129.  
  130. if IsA(p, baseclass) then
  131. table.insert(filtered, p)
  132. end
  133. end
  134. end
  135.  
  136. return filtered
  137. end
  138.  
  139.  
  140. local function GetChildrenWhichIsNotA(part, baseclass)
  141. local parts = GetChildren(part)
  142. local len = #parts
  143.  
  144. local filtered = {}
  145.  
  146. if len > 0 then
  147. for i = 1, len do
  148. local p = parts[i]
  149.  
  150. if not IsA(p, baseclass) then
  151. table.insert(filtered, p)
  152. end
  153. end
  154. end
  155.  
  156. return filtered
  157. end
  158.  
  159. if workspace.CurrentCamera then
  160. OnCameraChange()
  161. end
  162.  
  163. Connect(GetPropertyChangedSignal(workspace, "CurrentCamera"), OnCameraChange)
  164.  
  165. --//Methods
  166.  
  167. --//Gets bias value at a given distance
  168. function Aimbot:GetBiasAtDistance(distance)
  169. if self.Camera then
  170. return distance * self.DistanceBias * self.WidthFactor
  171. end
  172. end
  173.  
  174. --//Gets circle radius at a given distance
  175. function Aimbot:GetRadiusAtDistance(rpercent, distance)
  176. if self.Camera then
  177. if self.RadiusCap then
  178. if distance >= self.RadiusCap and rpercent ~= self.SilentRadiusPercentAt1 then
  179. distance = self.RadiusCap
  180. end
  181. end
  182.  
  183. return rpercent / distance * self.WidthFactor
  184. end
  185. end
  186.  
  187. --//Checks for parts obscuring camera, including terrain - unlike Camera:GetPartsObscuringTarget
  188. function Aimbot:GetBlockingPart(origin, position, ignore)
  189. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore --//Incase it got updated
  190.  
  191. local dir = position - origin
  192. local thisignore = self.WallCheckParams.FilterDescendantsInstances --//Copies table for you essentially
  193.  
  194. if ignore then
  195. table.move(ignore, 1, #ignore, #thisignore + 1, thisignore)
  196. end
  197.  
  198. while true do
  199. self.WallCheckParams.FilterDescendantsInstances = thisignore --//Copies
  200. local result = Raycast(workspace, origin, dir, self.WallCheckParams)
  201.  
  202. if result then
  203. if self.IgnoreTransparent and result.Instance.ClassName ~= "Terrain" and result.Instance.Transparency >= self.TransparencyThreshold then
  204. table.insert(thisignore, result.Instance)
  205. continue
  206. end
  207.  
  208. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  209. return result.Instance
  210. end
  211.  
  212. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  213. return nil
  214. end
  215. end
  216.  
  217. --//Gets target from viewport point
  218. function Aimbot:GetTargetFromViewportPoint(point, distance, ignore)
  219. local camera = self.Camera
  220.  
  221. if camera then
  222. local ray = ViewportPointToRay(camera, point.X, point.Y)
  223. return self:GetBlockingPart(ray.Origin, ray.Origin + ray.Direction * distance, ignore)
  224. end
  225. end
  226.  
  227. --//Gets closest edge on part from viewport point
  228. function Aimbot:GetClosestEdgeFromViewportPoint(point, part)
  229. local camera = self.Camera
  230.  
  231. if camera then
  232. local ray = ViewportPointToRay(camera, point.X, point.Y)
  233. local ppos = part.Position
  234.  
  235. local dist = (ray.Origin - ppos).Magnitude
  236. local dir = (ray.Origin + ray.Direction * dist - ppos).Unit
  237.  
  238. local size = part.Size
  239.  
  240. local half = size / 2
  241. local final = dir * size
  242.  
  243. return ppos + Vector3.new(
  244. final.X < 0 and math.max(final.X, -half.X + size.X / 10) or math.min(final.X, half.X - size.X / 10),
  245. final.Y < 0 and math.max(final.Y, -half.Y + size.Y / 10) or math.min(final.Y, half.Y - size.Y / 10),
  246. final.Z < 0 and math.max(final.Z, -half.Z + size.Z / 10) or math.min(final.Z, half.Z - size.Z / 10)
  247. )
  248. end
  249. end
  250.  
  251. --//Gets mouse location with offset accounted for
  252. function Aimbot:GetMouseViewportPoint()
  253. return GetMouseLocation(UserInputService) + self.Offset
  254. end
  255.  
  256. --//Gets best target from a list of parts and a viewport point, ignoreparent specifies whether to filter the entire parent
  257. function Aimbot:GetBestPartFromViewportPoint(position, parts, ignoreparent, ignore)
  258. local camera = self.Camera
  259.  
  260. if camera then
  261. local len = #parts
  262.  
  263. if len > 0 then
  264. local leastbias, leastwdist, leastpdist, part = math.huge, math.huge, math.huge, nil
  265. local campos = camera.CFrame.Position
  266.  
  267. ignore = ignore or {}
  268. local ipos = #ignore + 1
  269.  
  270. for i = 1, len do
  271. local cpart = parts[i]
  272. local cpos = cpart.Position
  273.  
  274. local point, onscreen = WorldToViewportPoint(camera, cpos)
  275. ignore[ipos] = ignoreparent and cpart.Parent or cpart
  276.  
  277. if onscreen and not self:GetBlockingPart(campos, cpos, ignore) then
  278. local pdist = (position - Vector2.new(point.X, point.Y)).Magnitude --//Pixel Distance
  279. local wdist = (campos - cpos).Magnitude --//World Distance
  280. local playerOb = cpart.Parent:FindFirstChildOfClass("Humanoid") and game:GetService("Players"):GetPlayerFromCharacter(cpart.Parent) or cpart.Parent.Parent:FindFirstChildOfClass("Humanoid") and game:GetService("Players"):GetPlayerFromCharacter(cpart.Parent.Parent)
  281.  
  282. if pdist <= self:GetRadiusAtDistance(self.Targets[playerOb] and self.RadiusPercentAt1 or self.FlickSettings.RadiusPercentAt1, wdist) then
  283. local bias = self:GetBiasAtDistance(wdist) + pdist
  284.  
  285. if bias < leastbias or (bias == leastbias and wdist < leastwdist) then
  286. leastbias = bias
  287. leastwdist = wdist
  288. leastpdist = pdist
  289. part = cpart
  290. end
  291. end
  292. end
  293. end
  294.  
  295. ignore[ipos] = nil
  296. return part, part and leastpdist <= self:GetRadiusAtDistance(self.SilentRadiusPercentAt1, leastwdist)
  297. end
  298. end
  299. end
  300.  
  301. --//Gets best player to target based on a viewport point
  302. function Aimbot:GetBestPlayerTargetFromViewportPoint(pos)
  303. if self.Camera then
  304. local plrs = GetPlayers(Players)
  305. local len = #plrs
  306.  
  307. if len > 0 then
  308. local parts = {}
  309. local lparts = 1
  310.  
  311. for i = 1, len do
  312. local plr = plrs[i]
  313. local charac = plr.Character
  314.  
  315. if plr ~= LocalPlayer and charac then
  316. if self.TeamCheck and not plr.Neutral and plr.Team == LocalPlayer.Team then
  317. continue
  318. end
  319.  
  320. if self.IsAliveCheck then
  321. local hum = FindFirstChildOfClass(charac, "Humanoid")
  322.  
  323. if not hum or hum.Health <= 0 then
  324. continue
  325. end
  326. end
  327.  
  328. if self.InvisibleCheck then
  329. local head = FindFirstChild(charac, "Head")
  330.  
  331. if not head or head.Transparency >= 1 then
  332. continue
  333. end
  334. end
  335.  
  336. if self.SizeCheck then
  337. local hum = FindFirstChild(charac, "HumanoidRootPart")
  338.  
  339. if not hum or hum.Size.X < 2 or hum.Size.Y < 2 or hum.Size.Z < 1 then
  340. continue
  341. end
  342. end
  343.  
  344. local filtered = GetChildrenWhichIsA(charac, "BasePart")
  345. local lfiltered = #filtered
  346.  
  347. table.move(filtered, 1, lfiltered, lparts, parts)
  348. lparts = lparts + lfiltered
  349. end
  350. end
  351. local target, silent = self:GetBestPartFromViewportPoint(pos, parts, true)
  352. local plrz = target and game:GetService("Players"):GetPlayerFromCharacter(target.Parent) or "nil"
  353. for aa, _ in pairs(self.Targets) do
  354. if aa ~= plrz then self.Targets[aa] = false end
  355. end
  356. if target then
  357. return target, silent
  358. end
  359. end
  360. end
  361. end
  362.  
  363. --//Begins aimbot
  364.  
  365. function Aimbot:Start()
  366. self.Enabled = true
  367. self.LastTrigger = 0
  368. self.TriggerPaused = false
  369. self.Targets = {}; setmetatable(self.Targets, {__index = function(s, k)
  370. s[k] = false
  371. return false
  372. end})
  373.  
  374. local relative
  375. local holding = false
  376. local mspoof
  377.  
  378. local lastframe = getclock()
  379.  
  380. if not self.RenderStep then
  381. local totalTime = 0
  382. self.RenderStep = Connect(RunService.RenderStepped, function(delta)
  383. totalTime += delta
  384. if (totalTime < 1 / 144) then return end
  385. totalTime = 0
  386. if self.Enabled and relative then
  387. if self.HoldControl and self.Holding or not self.HoldControl then
  388. mousemoverel(relative.X, relative.Y)
  389. end
  390. end
  391. end)
  392. end
  393.  
  394. if not self.Heartbeat then
  395. local totalTime = 0
  396. self.Heartbeat = Connect(RunService.Heartbeat, function(delta)
  397. totalTime += delta
  398. if (totalTime < 1 / 144) then return end
  399. totalTime = 0
  400. relative = nil
  401.  
  402. if self.Enabled then
  403. local camera = self.Camera
  404.  
  405. if camera then
  406. local mpos = self:GetMouseViewportPoint()
  407. local target, silent = self:GetBestPlayerTargetFromViewportPoint(mpos)
  408.  
  409. if not target then
  410. if holding then
  411. holding = false
  412. mouse1release()
  413. end
  414. end
  415.  
  416. if target then
  417. local charac = target.Parent
  418. local plrz = game:GetService("Players"):GetPlayerFromCharacter(charac)
  419. local lcharac = LocalPlayer.Character
  420. local cignore = GetChildrenWhichIsNotA(charac, "BasePart")
  421.  
  422. --if cignore then
  423. table.insert(cignore, lcharac)
  424. local mtarget = self:GetTargetFromViewportPoint(mpos, 5000, cignore)
  425. local bodyPart = (FindFirstChild(lcharac, "Head") or FindFirstChild(lcharac, "HumanoidRootPart"))
  426. local BlockingParts = self:GetBlockingPart(bodyPart and bodyPart.Position, target.Position, cignore)
  427. if silent and self.TriggerBot and lcharac and BlockingParts and BlockingParts:IsDescendantOf(charac) then
  428. if not holding then
  429. holding = true
  430. mouse1press()
  431. if self.AutoPeak.Enabled then
  432. if self.AutoPeak.PointPosition and lcharac and lcharac:FindFirstChildOfClass("Humanoid") then
  433. local PlayerModule = LocalPlayer.PlayerScripts:FindFirstChild("PlayerModule")
  434. if PlayerModule then
  435. local Controls = require(PlayerModule):GetControls()
  436. Controls:Disable()
  437. if self.AutoPeak.Object then self.AutoPeak.Object.Parent = nil end
  438. local tempCon; tempCon = lcharac:FindFirstChildOfClass("Humanoid").MoveToFinished:Connect(function(reached)
  439. if reached then self.AutoPeak.PointPosition = nil Controls:Enable() tempCon:Disconnect() end
  440. if not self.AutoPeak.PointPosition then self.AutoPeak.PointPosition = nil Controls:Enable() tempCon:Disconnect() end
  441. if not lcharac or not lcharac:FindFirstChildOfClass("Humanoid") or lcharac:FindFirstChildOfClass("Humanoid").Health <= 0 then self.AutoPeak.PointPosition = nil Controls:Enable() tempCon:Disconnect() end
  442. if not reached and self.AutoPeak.PointPosition then
  443. lcharac:FindFirstChildOfClass("Humanoid"):MoveTo(self.AutoPeak.PointPosition)
  444. end
  445. end)
  446. local temp2Con; temp2Con = lcharac:FindFirstChild("Humanoid").Died:Connect(function()
  447. if self.AutoPeak.PointPosition then
  448. Controls:Enable() self.AutoPeak.PointPosition = nil tempCon:Disconnect()
  449. end
  450. temp2Con:Disconnect()
  451. end)
  452. lcharac:FindFirstChildOfClass("Humanoid"):MoveTo(self.AutoPeak.PointPosition)
  453. end
  454. end
  455. end
  456. else
  457. if self.TriggerBotSemi and (tick() - self.LastTrigger) >= self.TriggerBotTimeBetweenClick and not self.TriggerPaused then
  458. self.TriggerPaused = true
  459. task.wait(self.TriggerBotTime / 1000)
  460. mouse1press()
  461. self.LastTrigger = tick()
  462. self.TriggerPaused = false
  463. end
  464. end
  465. elseif silent and self.TriggerBot and lcharac and (not BlockingParts or not BlockingParts:IsDescendantOf(charac)) then
  466. if holding then
  467. holding = false
  468. mouse1release()
  469. end
  470. end
  471.  
  472. if mtarget and IsDescendantOf(mtarget, charac) then
  473. mspoof = nil
  474. self.Targets[plrz] = true
  475. if not self.TargetPart then
  476. return
  477. end
  478. elseif silent then
  479. mspoof = self:GetClosestEdgeFromViewportPoint(mpos, target)
  480. else
  481. mspoof = nil
  482. end
  483.  
  484. target = (self.TargetPart and FindFirstChild(charac, self.TargetPart)) or target
  485. --local pos, onscreen = WorldToViewportPoint(camera, target.Position)
  486. local pos, onscreen = WorldToViewportPoint(camera, self:GetClosestEdgeFromViewportPoint(mpos, target))
  487. if onscreen then
  488. if self.Targets[plrz] then
  489. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.XSmoothingPercent * self.WidthFactor, self.YSmoothingPercent * self.WidthFactor)
  490. else
  491. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.FlickSettings.FlickXSmoothingPercent * self.WidthFactor, self.FlickSettings.FlickYSmoothingPercent * self.WidthFactor)
  492. end
  493. end
  494. else
  495. if holding then
  496. holding = false
  497. mouse1release()
  498. end
  499.  
  500. mspoof = nil
  501. end
  502. else
  503. if holding then
  504. holding = false
  505. mouse1release()
  506. end
  507.  
  508. mspoof = nil
  509. end
  510. else
  511. if holding then
  512. holding = false
  513. mouse1release()
  514. end
  515.  
  516. mspoof = nil
  517. end
  518. end)
  519. end
  520. local Players2 = game.GetService(game, "Players");
  521. local Client2 = Players2.LocalPlayer;
  522. local Mouse2 = Client2.GetMouse(Client2);
  523.  
  524. local old; old = hookmetamethod(game, "__index", newcclosure(function(i,v)
  525. if string.lower(v) == "hit" then
  526. if old(i, "ClassName") == "Mouse" or old(i, "ClassName") == "PlayerMouse" then
  527. if not checkcaller() then
  528. if mspoof then
  529. return CFrame.new(mspoof)
  530. end
  531. end
  532. end
  533. end
  534. return old(i,v)
  535. end))
  536.  
  537. local old2; old2 = hookmetamethod(game, "__namecall", function(self2, ...)
  538. if getnamecallmethod() == "ViewportPointToRay" and not checkcaller() and mspoof then
  539. local args = {...}
  540. local pos = GetMouseLocation(UserInputService)
  541. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  542. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  543. args[1] = newPos.X
  544. args[2] = newPos.Y
  545. return old2(self2, table.unpack(args))
  546. else
  547. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  548. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  549. args[1] = newPos.X
  550. args[2] = newPos.Y
  551. return old2(self2, table.unpack(args))
  552. end
  553. end
  554. elseif getnamecallmethod() == "ScreenPointToRay" and not checkcaller() and mspoof then
  555. local args = {...}
  556. local pos = GetMouseLocation(UserInputService)
  557. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  558. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  559. args[1] = newPos.X
  560. args[2] = newPos.Y
  561. return old2(self2, table.unpack(args))
  562. else
  563. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  564. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  565. args[1] = newPos.X
  566. args[2] = newPos.Y
  567. return old2(self2, table.unpack(args))
  568. end
  569. end
  570. end
  571. return old2(self2, ...)
  572. end)
  573.  
  574. --[[
  575. local old2; old2 = hookmetamethod(game, "__namecall", function(self2, ...)
  576. local args = {...}
  577. if getnamecallmethod() == "ScreenPointToRay" or getnamecallmethod() == "ViewportPointToRay" and mspoof then
  578. local SecondPosition = game.GetService(game, "UserInputService").GetMouseLocation(game.GetService(game, "UserInputService"))
  579. if args[1] == Mouse2.X and args[2] == Mouse2.Y or args[1] == SecondPosition.X and args[2] == SecondPosition.Y then
  580. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  581. args[1] = newPos.X
  582. args[2] = newPos.Y
  583. return old2(self2, table.unpack(args))
  584. end
  585. end
  586. return old2(self2, ...)
  587. end)
  588. --]]
  589.  
  590. game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent)
  591. if input.KeyCode == Enum.KeyCode.Q then
  592. if not gameProcessedEvent then
  593. local lcharac = LocalPlayer.Character
  594. if lcharac and lcharac:FindFirstChildOfClass("Humanoid") then
  595. if self.AutoPeak.Object and self.AutoPeak.Object.Parent == nil then
  596. self.AutoPeak.PointPosition = lcharac:FindFirstChild("HumanoidRootPart").Position
  597. self.AutoPeak.Object.Parent = workspace
  598. self.AutoPeak.Object.Position = self.AutoPeak.PointPosition
  599. else
  600. if not self.AutoPeak.Object then
  601. self.AutoPeak.PointPosition = lcharac:FindFirstChild("HumanoidRootPart").Position
  602. local peakPoint = Instance.new("Part")
  603. peakPoint.Shape = Enum.PartType.Ball
  604. peakPoint.Color = Color3.fromRGB(0,255,0)
  605. peakPoint.Anchored = true
  606. peakPoint.CanCollide = false
  607. peakPoint.Size = Vector3.new(0.2,0.2,0.2)
  608. self.AutoPeak.Object = peakPoint
  609. self.AutoPeak.Object.Parent = workspace
  610. self.AutoPeak.Object.Position = self.AutoPeak.PointPosition
  611. elseif self.AutoPeak.Object.Parent ~= nil then
  612. self.AutoPeak.Object.Parent = nil
  613. self.AutoPeak.PointPosition = nil
  614. local PlayerModule = LocalPlayer.PlayerScripts:FindFirstChild("PlayerModule")
  615. if PlayerModule then
  616. local Controls = require(PlayerModule):GetControls()
  617. Controls:Disable()
  618. end
  619. end
  620. end
  621. end
  622. end
  623. end
  624. end)
  625. end
  626.  
  627. --//Completely kills aimbot, as opposed to enabled = false
  628. function Aimbot:Kill()
  629. self.Enabled = false
  630.  
  631. if self.RenderStep then
  632. Disconnect(self.RenderStep)
  633. self.RenderStep = nil
  634. end
  635.  
  636. if self.Heartbeat then
  637. Disconnect(self.Heartbeat)
  638. self.Heartbeat = nil
  639. end
  640. end
  641.  
  642. --//Constructor
  643. function Aimbot.new(presets)
  644. presets = presets or {}
  645. UpdateTable(presets, Aimbot.DefaultSettings)
  646.  
  647. local WallCheckParams = RaycastParams.new()
  648. WallCheckParams.FilterType = Enum.RaycastFilterType.Blacklist
  649. WallCheckParams.IgnoreWater = presets.IgnoreWater
  650. WallCheckParams.FilterDescendantsInstances = presets.DefaultIgnore
  651.  
  652. presets.WallCheckParams = WallCheckParams
  653. return setmetatable(presets, Aimbot)
  654. end
  655.  
  656. --//Return with default settings
  657. return Aimbot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement