Advertisement
eruaaaaaaa

Untitled

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