eruaaaaaaa

Untitled

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