Advertisement
eruaaaaaaa

Untitled

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