eruaaaaaaa

Untitled

May 12th, 2022 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.00 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. local function GetDescendantsWhichIsNotA(part, baseclass)
  180. local parts = GetDescendants(part)
  181. local len = #parts
  182.  
  183. local filtered = {}
  184.  
  185. if len > 0 then
  186. for i = 1, len do
  187. local p = parts[i]
  188.  
  189. if not IsA(p, baseclass) then
  190. table.insert(filtered, p)
  191. end
  192. end
  193. end
  194.  
  195. return filtered
  196. end
  197.  
  198. if workspace.CurrentCamera then
  199. OnCameraChange()
  200. end
  201.  
  202. Connect(GetPropertyChangedSignal(workspace, "CurrentCamera"), OnCameraChange)
  203.  
  204. --//Methods
  205.  
  206. --//Gets bias value at a given distance
  207. function Aimbot:GetBiasAtDistance(distance)
  208. if self.Camera then
  209. return distance * self.DistanceBias * self.WidthFactor
  210. end
  211. end
  212.  
  213. --//Gets circle radius at a given distance
  214. function Aimbot:GetRadiusAtDistance(rpercent, distance)
  215. if self.Camera then
  216. if self.RadiusCap then
  217. if distance >= self.RadiusCap and rpercent ~= self.SilentRadiusPercentAt1 then
  218. distance = self.RadiusCap
  219. end
  220. end
  221.  
  222. return rpercent / distance * self.WidthFactor
  223. end
  224. end
  225.  
  226. --//Checks for parts obscuring camera, including terrain - unlike Camera:GetPartsObscuringTarget
  227. function Aimbot:GetBlockingPart(origin, position, ignore)
  228. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore --//Incase it got updated
  229.  
  230. local dir = position - origin
  231. local thisignore = self.WallCheckParams.FilterDescendantsInstances --//Copies table for you essentially
  232.  
  233. if ignore then
  234. table.move(ignore, 1, #ignore, #thisignore + 1, thisignore)
  235. end
  236.  
  237. while true do
  238. self.WallCheckParams.FilterDescendantsInstances = thisignore --//Copies
  239. local result = Raycast(workspace, origin, dir, self.WallCheckParams)
  240.  
  241. if result then
  242. if self.IgnoreTransparent and result.Instance.ClassName ~= "Terrain" and result.Instance.Transparency >= self.TransparencyThreshold then
  243. table.insert(thisignore, result.Instance)
  244. continue
  245. end
  246.  
  247. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  248. return result.Instance
  249. end
  250.  
  251. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  252. return nil
  253. end
  254. end
  255.  
  256. --//Gets target from viewport point
  257. function Aimbot:GetTargetFromViewportPoint(point, distance, ignore)
  258. local camera = self.Camera
  259.  
  260. if camera then
  261. local ray = ViewportPointToRay(camera, point.X, point.Y)
  262. return self:GetBlockingPart(ray.Origin, ray.Origin + ray.Direction * distance, ignore)
  263. end
  264. end
  265.  
  266. --//Gets closest edge on part from viewport point
  267. function Aimbot:GetClosestEdgeFromViewportPoint(point, part)
  268. local camera = self.Camera
  269.  
  270. if camera then
  271. local Blacklisted = {
  272. ["Right Arm"] = "LeftSurface",
  273. ["Left Arm"] = "RightSurface",
  274. ["Right Leg"] = "TopSurface",
  275. ["Left Leg"] = "TopSurface",
  276. ["Head"] = "BottomSurface"
  277. }
  278.  
  279. local ray = ViewportPointToRay(camera, point.X, point.Y)
  280. local ppos = part.Position
  281.  
  282. local dist = (ray.Origin - ppos).Magnitude
  283. local dir = (ray.Origin + ray.Direction * dist - ppos).Unit
  284.  
  285. local size = part.Size
  286.  
  287. local half = size / 2
  288. local final = dir * size
  289.  
  290. local Pos = ppos + Vector3.new(
  291. final.X < 0 and math.max(final.X, -half.X + size.X / 10) or math.min(final.X, half.X - size.X / 10),
  292. final.Y < 0 and math.max(final.Y, -half.Y + size.Y / 10) or math.min(final.Y, half.Y - size.Y / 10),
  293. final.Z < 0 and math.max(final.Z, -half.Z + size.Z / 10) or math.min(final.Z, half.Z - size.Z / 10)
  294. )
  295.  
  296. local g = {
  297. TopSurface = part.CFrame * CFrame.new(0, part.Size.Y / 2, 0) * CFrame.Angles(math.pi / 2, 0, 0),
  298. BottomSurface = part.CFrame * CFrame.new(0, part.Size.Y / -2, 0) * CFrame.Angles(math.pi / -2, 0, 0),
  299. FrontSurface = part.CFrame * CFrame.new(0, 0, part.Size.Z / -2),
  300. BackSurface = part.CFrame * CFrame.new(0, 0, part.Size.Z / 2) * CFrame.Angles(0, math.pi, 0),
  301. LeftSurface = part.CFrame * CFrame.new(part.Size.X / -2, 0, 0) * CFrame.Angles(0, math.pi / 2, 0),
  302. RightSurface = part.CFrame * CFrame.new(part.Size.X / 2, 0, 0) * CFrame.Angles(0, math.pi / -2, 0)
  303. }
  304.  
  305. local closest = math.huge
  306. local new = nil
  307. for i,v in pairs(g) do
  308. local h = (Pos - v.Position).Magnitude
  309. if h < closest then
  310. new = i
  311. closest = h
  312. end
  313. end
  314.  
  315. if Blacklisted[part.Name] ~= new then
  316. return Pos
  317. end
  318. end
  319. end
  320.  
  321. --//Gets mouse location with offset accounted for
  322. function Aimbot:GetMouseViewportPoint()
  323. return GetMouseLocation(UserInputService) + self.Offset
  324. end
  325.  
  326. --//Gets best target from a list of parts and a viewport point, ignoreparent specifies whether to filter the entire parent
  327. function Aimbot:GetBestPartFromViewportPoint(position, parts, ignoreparent, ignore)
  328. local camera = self.Camera
  329.  
  330. if camera then
  331. local len = #parts
  332.  
  333. if len > 0 then
  334. local leastbias, leastwdist, leastpdist, part = math.huge, math.huge, math.huge, nil
  335. local campos = camera.CFrame.Position
  336.  
  337. ignore = ignore or {}
  338. local ipos = #ignore + 1
  339.  
  340. for i = 1, len do
  341. local cpart = parts[i]
  342. local cpos = cpart.Position
  343.  
  344. local point, onscreen = WorldToViewportPoint(camera, cpos)
  345. ignore[ipos] = ignoreparent and cpart.Parent or cpart
  346.  
  347. if onscreen and not self:GetBlockingPart(campos, cpos, ignore) then
  348. local pdist = (position - Vector2.new(point.X, point.Y)).Magnitude --//Pixel Distance
  349. local wdist = (campos - cpos).Magnitude --//World Distance
  350. 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)
  351.  
  352. if pdist <= self:GetRadiusAtDistance(self.Targets[playerOb] and self.RadiusPercentAt1 or self.FlickSettings.RadiusPercentAt1, wdist) then
  353. local bias = self:GetBiasAtDistance(wdist) + pdist
  354.  
  355. if bias < leastbias or (bias == leastbias and wdist < leastwdist) then
  356. leastbias = bias
  357. leastwdist = wdist
  358. leastpdist = pdist
  359. part = cpart
  360. end
  361. end
  362. end
  363. end
  364.  
  365. ignore[ipos] = nil
  366. return part, part and leastpdist <= self:GetRadiusAtDistance(self.SilentRadiusPercentAt1, leastwdist)
  367. end
  368. end
  369. end
  370.  
  371. --//Gets best player to target based on a viewport point
  372. function Aimbot:GetBestPlayerTargetFromViewportPoint(pos)
  373. if self.Camera then
  374. local plrs = GetPlayers(Players)
  375. local len = #plrs
  376.  
  377. if len > 0 then
  378. local parts = {}
  379. local lparts = 1
  380. local maxPlr = {}
  381. for i = 1, len do
  382. local plr = plrs[i]
  383. local charac = plr.Character
  384.  
  385. if plr ~= LocalPlayer and charac then
  386. if self.TeamCheck and not plr.Neutral and plr.Team == LocalPlayer.Team then
  387. continue
  388. end
  389.  
  390. if self.IsAliveCheck then
  391. local hum = FindFirstChildOfClass(charac, "Humanoid")
  392.  
  393. if not hum or hum.Health <= 0 then
  394. continue
  395. end
  396. end
  397.  
  398. if self.InvisibleCheck then
  399. local head = FindFirstChild(charac, "Head")
  400.  
  401. if not head or head.Transparency >= 1 then
  402. continue
  403. end
  404. end
  405.  
  406. if self.SizeCheck then
  407. local hum = FindFirstChild(charac, "HumanoidRootPart")
  408.  
  409. if not hum or hum.Size.X < 2 or hum.Size.Y < 2 or hum.Size.Z < 1 then
  410. continue
  411. end
  412. end
  413.  
  414. if self.AntiLag then
  415. if #maxPlr >= 4 then continue end
  416. table.insert(maxPlr, plr)
  417. end
  418.  
  419. local filtered = GetChildrenWhichIsA(charac, "BasePart")
  420. local lfiltered = #filtered
  421.  
  422. table.move(filtered, 1, lfiltered, lparts, parts)
  423. lparts = lparts + lfiltered
  424. end
  425. end
  426. local target, silent = self:GetBestPartFromViewportPoint(pos, parts, true)
  427. local plrz = target and game:GetService("Players"):GetPlayerFromCharacter(target.Parent) or "nil"
  428. for aa, _ in pairs(self.Targets) do
  429. if aa ~= plrz then self.Targets[aa] = false end
  430. end
  431. if target then
  432. return target, silent
  433. end
  434. end
  435. end
  436. end
  437.  
  438. --//Begins aimbot
  439.  
  440. function Aimbot:Start()
  441. self.Enabled = true
  442. self.LastTrigger = 0
  443. self.TriggerPaused = false
  444. self.Targets = {}; setmetatable(self.Targets, {__index = function(s, k)
  445. s[k] = false
  446. return false
  447. end})
  448.  
  449. local relative
  450. local holding = false
  451. local mspoof
  452.  
  453. local lastframe = getclock()
  454.  
  455. if not self.RenderStep then
  456. local totalTime = 0
  457. self.RenderStep = Connect(RunService.RenderStepped, function(delta)
  458. totalTime += delta
  459. if (totalTime < 1 / 144) then return end
  460. totalTime = 0
  461. if self.Enabled and relative then
  462. if self.HoldControl and self.Holding or not self.HoldControl then
  463. mousemoverel(relative.X, relative.Y)
  464. end
  465. end
  466. end)
  467. end
  468.  
  469. if not self.Heartbeat then
  470. local totalTime = 0
  471. self.Heartbeat = Connect(RunService.Heartbeat, function(delta)
  472. totalTime += delta
  473. if (totalTime < 1 / 144) then return end
  474. totalTime = 0
  475. relative = nil
  476.  
  477. if self.Enabled then
  478. local camera = self.Camera
  479.  
  480. if camera then
  481. local mpos = self:GetMouseViewportPoint()
  482. local target, silent = self:GetBestPlayerTargetFromViewportPoint(mpos)
  483.  
  484. if not target then
  485. if holding then
  486. holding = false
  487. mouse1release()
  488. end
  489. end
  490.  
  491. if target then
  492. local charac = target.Parent
  493. local plrz = game:GetService("Players"):GetPlayerFromCharacter(charac)
  494. local lcharac = LocalPlayer.Character
  495. local cignore = GetDescendantsWhichIsNotA(charac, "BasePart")
  496.  
  497. --if cignore then
  498. table.insert(cignore, lcharac)
  499. local mtarget = self:GetTargetFromViewportPoint(mpos, 5000, cignore)
  500. local bodyPart = (FindFirstChild(lcharac, "Head") or FindFirstChild(lcharac, "HumanoidRootPart"))
  501. local BlockingParts = self:GetBlockingPart(bodyPart and bodyPart.Position, target.Position, cignore)
  502. if silent and self.TriggerBot and lcharac and BlockingParts and BlockingParts:IsDescendantOf(charac) then
  503. if not holding then
  504. holding = true
  505. mouse1press()
  506. else
  507. if self.TriggerBotSemi and (tick() - self.LastTrigger) >= self.TriggerBotTimeBetweenClick and not self.TriggerPaused then
  508. self.TriggerPaused = true
  509. task.wait(self.TriggerBotTime / 1000)
  510. mouse1press()
  511. self.LastTrigger = tick()
  512. self.TriggerPaused = false
  513. end
  514. end
  515. elseif silent and self.TriggerBot and lcharac and (not BlockingParts or not BlockingParts:IsDescendantOf(charac)) then
  516. if holding then
  517. holding = false
  518. mouse1release()
  519. end
  520. end
  521.  
  522. if mtarget and IsDescendantOf(mtarget, charac) and not (string.find(mtarget.Name:lower(), "arm") or string.find(mtarget.Name:lower(), "leg")) then
  523. mspoof = nil
  524. self.Targets[plrz] = true
  525. if self.Deadzone.Enabled then
  526. target = (self.TargetPart and FindFirstChild(charac, self.TargetPart)) or target
  527. local pos, onscreen = WorldToViewportPoint(camera, target.Position)
  528. if onscreen then
  529. local g = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.Deadzone.XSmoothingPercent * self.WidthFactor, self.Deadzone.YSmoothingPercent * self.WidthFactor)
  530. mousemoverel(g.X, g.Y)
  531. end
  532. end
  533. if not self.TargetPart then
  534. return
  535. end
  536. elseif silent then
  537. mspoof = self:GetClosestEdgeFromViewportPoint(mpos, target)
  538. else
  539. mspoof = nil
  540. end
  541.  
  542. target = (self.TargetPart and FindFirstChild(charac, self.TargetPart)) or charac:FindFirstChild("HumanoidRootPart")
  543. --local pos, onscreen = WorldToViewportPoint(camera, target.Position)
  544. local g = target.Position
  545. if g then
  546.  
  547. local pos, onscreen = WorldToViewportPoint(camera, g)
  548. if onscreen then
  549. if self.Targets[plrz] then
  550. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.XSmoothingPercent * self.WidthFactor, self.YSmoothingPercent * self.WidthFactor)
  551. else
  552. if self.FlickSettings.Flick then
  553. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.FlickSettings.FlickXSmoothingPercent * self.WidthFactor, self.FlickSettings.FlickYSmoothingPercent * self.WidthFactor)
  554. end
  555. end
  556. end
  557. end
  558. else
  559. if holding then
  560. holding = false
  561. mouse1release()
  562. end
  563.  
  564. mspoof = nil
  565. end
  566. else
  567. if holding then
  568. holding = false
  569. mouse1release()
  570. end
  571.  
  572. mspoof = nil
  573. end
  574. else
  575. if holding then
  576. holding = false
  577. mouse1release()
  578. end
  579.  
  580. mspoof = nil
  581. end
  582. end)
  583. end
  584. local Players2 = game.GetService(game, "Players");
  585. local Client2 = Players2.LocalPlayer;
  586. local Mouse2 = Client2.GetMouse(Client2);
  587.  
  588. local old; old = hookmetamethod(game, "__index", newcclosure(function(i,v)
  589. if string.lower(v) == "hit" then
  590. if old(i, "ClassName") == "Mouse" or old(i, "ClassName") == "PlayerMouse" then
  591. if not checkcaller() then
  592. if mspoof then
  593. return CFrame.new(mspoof)
  594. end
  595. end
  596. end
  597. end
  598. return old(i,v)
  599. end))
  600.  
  601. local old2; old2 = hookmetamethod(game, "__namecall", newcclosure(function(self2, ...)
  602. if getnamecallmethod() == "ViewportPointToRay" and not checkcaller() and mspoof then
  603. local args = {...}
  604. local pos = GetMouseLocation(UserInputService)
  605. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  606. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  607. args[1] = newPos.X
  608. args[2] = newPos.Y
  609. return old2(self2, table.unpack(args))
  610. else
  611. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  612. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  613. args[1] = newPos.X
  614. args[2] = newPos.Y
  615. return old2(self2, table.unpack(args))
  616. end
  617. end
  618. elseif getnamecallmethod() == "ScreenPointToRay" and not checkcaller() and mspoof then
  619. local args = {...}
  620. local pos = GetMouseLocation(UserInputService)
  621. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  622. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  623. args[1] = newPos.X
  624. args[2] = newPos.Y
  625. return old2(self2, table.unpack(args))
  626. else
  627. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  628. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  629. args[1] = newPos.X
  630. args[2] = newPos.Y
  631. return old2(self2, table.unpack(args))
  632. end
  633. end
  634. end
  635. return old2(self2, ...)
  636. end))
  637.  
  638. --[[
  639. local old2; old2 = hookmetamethod(game, "__namecall", function(self2, ...)
  640. local args = {...}
  641. if getnamecallmethod() == "ScreenPointToRay" or getnamecallmethod() == "ViewportPointToRay" and mspoof then
  642. local SecondPosition = game.GetService(game, "UserInputService").GetMouseLocation(game.GetService(game, "UserInputService"))
  643. if args[1] == Mouse2.X and args[2] == Mouse2.Y or args[1] == SecondPosition.X and args[2] == SecondPosition.Y then
  644. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  645. args[1] = newPos.X
  646. args[2] = newPos.Y
  647. return old2(self2, table.unpack(args))
  648. end
  649. end
  650. return old2(self2, ...)
  651. end)
  652. --]]
  653. end
  654.  
  655. --//Completely kills aimbot, as opposed to enabled = false
  656. function Aimbot:Kill()
  657. self.Enabled = false
  658.  
  659. if self.RenderStep then
  660. Disconnect(self.RenderStep)
  661. self.RenderStep = nil
  662. end
  663.  
  664. if self.Heartbeat then
  665. Disconnect(self.Heartbeat)
  666. self.Heartbeat = nil
  667. end
  668. end
  669.  
  670. --//Constructor
  671. function Aimbot.new(presets)
  672. presets = presets or {}
  673. UpdateTable(presets, Aimbot.DefaultSettings)
  674.  
  675. local WallCheckParams = RaycastParams.new()
  676. WallCheckParams.FilterType = Enum.RaycastFilterType.Blacklist
  677. WallCheckParams.IgnoreWater = presets.IgnoreWater
  678. WallCheckParams.FilterDescendantsInstances = presets.DefaultIgnore
  679.  
  680. presets.WallCheckParams = WallCheckParams
  681. return setmetatable(presets, Aimbot)
  682. end
  683.  
  684. --//Return with default settings
  685. return Aimbot
Add Comment
Please, Sign In to add comment