Advertisement
eruaaaaaaa

Untitled

Sep 4th, 2022
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.11 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 Mouse = LocalPlayer.GetMouse(LocalPlayer)
  108. local GuiInset = GuiService.GetGuiInset(GuiService)
  109. local GameMeta = getrawmetatable(game)
  110.  
  111. local function OnCameraChange()
  112. local cam = workspace.CurrentCamera
  113.  
  114. Aimbot.Camera = cam
  115. Aimbot.ViewportSize = cam.ViewportSize
  116. Aimbot.WidthFactor = cam.ViewportSize.X / 100
  117. end
  118.  
  119. local function UpdateTable(tab, update)
  120. for name, value in pairs(update) do
  121. if tab[name] == nil then
  122. tab[name] = value
  123. end
  124. end
  125. end
  126.  
  127. local function GetChildrenWhichIsA(part, baseclass)
  128. local parts = GetChildren(part)
  129. local len = #parts
  130.  
  131. local filtered = {}
  132.  
  133. if len > 0 then
  134. for i = 1, len do
  135. local p = parts[i]
  136.  
  137. if IsA(p, baseclass) then
  138. table.insert(filtered, p)
  139. end
  140. end
  141. end
  142.  
  143. return filtered
  144. end
  145.  
  146. local function GetDescendantsWhichIsA(part, baseclass)
  147. local parts = GetDescendants(part)
  148. local len = #parts
  149.  
  150. local filtered = {}
  151.  
  152. if len > 0 then
  153. for i = 1, len do
  154. local p = parts[i]
  155.  
  156. if IsA(p, baseclass) then
  157. table.insert(filtered, p)
  158. end
  159. end
  160. end
  161.  
  162. return filtered
  163. end
  164.  
  165.  
  166. local function GetChildrenWhichIsNotA(part, baseclass)
  167. local parts = GetChildren(part)
  168. local len = #parts
  169.  
  170. local filtered = {}
  171.  
  172. if len > 0 then
  173. for i = 1, len do
  174. local p = parts[i]
  175.  
  176. if not IsA(p, baseclass) then
  177. table.insert(filtered, p)
  178. end
  179. end
  180. end
  181.  
  182. return filtered
  183. end
  184.  
  185. if workspace.CurrentCamera then
  186. OnCameraChange()
  187. end
  188.  
  189. Connect(GetPropertyChangedSignal(workspace, "CurrentCamera"), OnCameraChange)
  190.  
  191. --//Methods
  192.  
  193. --//Gets bias value at a given distance
  194. function Aimbot:GetBiasAtDistance(distance)
  195. if self.Camera then
  196. return distance * self.DistanceBias * self.WidthFactor
  197. end
  198. end
  199.  
  200. --//Gets circle radius at a given distance
  201. function Aimbot:GetRadiusAtDistance(rpercent, distance)
  202. if self.Camera then
  203. if self.RadiusCap then
  204. if distance >= self.RadiusCap and rpercent ~= self.SilentRadiusPercentAt1 and rpercent == self.RadiusPercentAt1 then
  205. distance = self.RadiusCap
  206. end
  207. end
  208.  
  209. return rpercent / distance * self.WidthFactor
  210. end
  211. end
  212.  
  213. --//Checks for parts obscuring camera, including terrain - unlike Camera:GetPartsObscuringTarget
  214. function Aimbot:GetBlockingPart(origin, position, ignore)
  215. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore --//Incase it got updated
  216.  
  217. local dir = position - origin
  218. local thisignore = self.WallCheckParams.FilterDescendantsInstances --//Copies table for you essentially
  219.  
  220. if ignore then
  221. table.move(ignore, 1, #ignore, #thisignore + 1, thisignore)
  222. end
  223.  
  224. while true do
  225. self.WallCheckParams.FilterDescendantsInstances = thisignore --//Copies
  226. local result = Raycast(workspace, origin, dir, self.WallCheckParams)
  227.  
  228. if result then
  229. if self.IgnoreTransparent and result.Instance.ClassName ~= "Terrain" and result.Instance.Transparency >= self.TransparencyThreshold then
  230. table.insert(thisignore, result.Instance)
  231. continue
  232. end
  233.  
  234. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  235. return result.Instance
  236. end
  237.  
  238. self.WallCheckParams.FilterDescendantsInstances = self.DefaultIgnore
  239. return nil
  240. end
  241. end
  242.  
  243. --//Gets target from viewport point
  244. function Aimbot:GetTargetFromViewportPoint(point, distance, ignore)
  245. local camera = self.Camera
  246.  
  247. if camera then
  248. local ray = ViewportPointToRay(camera, point.X, point.Y)
  249. return self:GetBlockingPart(ray.Origin, ray.Origin + ray.Direction * distance, ignore)
  250. end
  251. end
  252.  
  253. --//Gets closest edge on part from viewport point
  254. function Aimbot:GetClosestEdgeFromViewportPoint(point, part)
  255. local camera = self.Camera
  256.  
  257. if camera then
  258. local Blacklisted = {
  259. ["Right Arm"] = "LeftSurface",
  260. ["Left Arm"] = "RightSurface",
  261. ["Right Leg"] = "TopSurface",
  262. ["Left Leg"] = "TopSurface",
  263. ["Head"] = "BottomSurface"
  264. }
  265.  
  266. local ray = ViewportPointToRay(camera, point.X, point.Y)
  267. local ppos = part.Position
  268.  
  269. local dist = (ray.Origin - ppos).Magnitude
  270. local dir = (ray.Origin + ray.Direction * dist - ppos).Unit
  271.  
  272. local size = part.Size
  273.  
  274. local half = size / 2
  275. local final = dir * size
  276.  
  277. local Pos = ppos + Vector3.new(
  278. final.X < 0 and math.max(final.X, -half.X + size.X / 10) or math.min(final.X, half.X - size.X / 10),
  279. final.Y < 0 and math.max(final.Y, -half.Y + size.Y / 10) or math.min(final.Y, half.Y - size.Y / 10),
  280. final.Z < 0 and math.max(final.Z, -half.Z + size.Z / 10) or math.min(final.Z, half.Z - size.Z / 10)
  281. )
  282.  
  283. local g = {
  284. TopSurface = part.CFrame * CFrame.new(0, part.Size.Y / 2, 0) * CFrame.Angles(math.pi / 2, 0, 0),
  285. BottomSurface = part.CFrame * CFrame.new(0, part.Size.Y / -2, 0) * CFrame.Angles(math.pi / -2, 0, 0),
  286. FrontSurface = part.CFrame * CFrame.new(0, 0, part.Size.Z / -2),
  287. BackSurface = part.CFrame * CFrame.new(0, 0, part.Size.Z / 2) * CFrame.Angles(0, math.pi, 0),
  288. LeftSurface = part.CFrame * CFrame.new(part.Size.X / -2, 0, 0) * CFrame.Angles(0, math.pi / 2, 0),
  289. RightSurface = part.CFrame * CFrame.new(part.Size.X / 2, 0, 0) * CFrame.Angles(0, math.pi / -2, 0)
  290. }
  291.  
  292. local closest = math.huge
  293. local new = nil
  294. for i,v in pairs(g) do
  295. local h = (Pos - v.Position).Magnitude
  296. if h < closest then
  297. new = i
  298. closest = h
  299. end
  300. end
  301.  
  302. if Blacklisted[part.Name] ~= new then
  303. return Pos
  304. end
  305. end
  306. end
  307.  
  308. --//Gets mouse location with offset accounted for
  309. function Aimbot:GetMouseViewportPoint()
  310. return GetMouseLocation(UserInputService) + self.Offset
  311. end
  312.  
  313. --//Gets best target from a list of parts and a viewport point, ignoreparent specifies whether to filter the entire parent
  314. function Aimbot:GetBestPartFromViewportPoint(position, parts, ignoreparent, ignore)
  315. local camera = self.Camera
  316.  
  317. if camera then
  318. local len = #parts
  319.  
  320. if len > 0 then
  321. local leastbias, leastwdist, leastpdist, part = math.huge, math.huge, math.huge, nil
  322. local campos = camera.CFrame.Position
  323.  
  324. ignore = ignore or {}
  325. local ipos = #ignore + 1
  326.  
  327. for i = 1, len do
  328. local cpart = parts[i]
  329. local cpos = cpart.Position
  330.  
  331. local point, onscreen = WorldToViewportPoint(camera, cpos)
  332. ignore[ipos] = ignoreparent and cpart.Parent or cpart
  333.  
  334. if onscreen and not self:GetBlockingPart(campos, cpos, ignore) then
  335. local pdist = (position - Vector2.new(point.X, point.Y)).Magnitude --//Pixel Distance
  336. local wdist = (campos - cpos).Magnitude --//World Distance
  337. 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)
  338.  
  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.  
  448. self.RenderStep = Connect(RunService.RenderStepped, function(delta)
  449. local timee = tick()
  450. if timee > lastt + fdelt or (1 / delta < 60) then
  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.  
  460. if not self.Heartbeat then
  461. local lastt = 0
  462. local fdelt = 0.016666666666666666
  463. self.Heartbeat = Connect(RunService.Heartbeat, function(delta)
  464. local timee = tick()
  465. if timee > lastt + fdelt or (1 / delta < 60) then
  466. lastt = timee
  467. relative = nil
  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 mtarget and IsDescendantOf(mtarget, charac) then
  545. mspoof = nil
  546. self.Targets[plrz] = true
  547.  
  548. if not self.Disabled then
  549. self.Disabled = true
  550. task.delay(self.DelayD, function()
  551. self.Disabled = false
  552. end)
  553. end
  554. if not self.TargetPart then
  555. return
  556. end
  557. elseif silent then
  558. mspoof = self:GetClosestEdgeFromViewportPoint(mpos, target)
  559. else
  560. mspoof = nil
  561. end
  562.  
  563. if self.Targets[plrz] then
  564. if self.Deadzone.Enabled then
  565. target = (self.TargetPart and FindFirstChild(charac, self.TargetPart)) or target
  566. local pos, onscreen = WorldToViewportPoint(camera, target.Position)
  567. if onscreen and not self.Disabled then
  568. local g = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.Deadzone.XSmoothingPercent * self.WidthFactor, self.Deadzone.YSmoothingPercent * self.WidthFactor)
  569. mousemoverel(g.X, g.Y)
  570. end
  571. end
  572. end
  573.  
  574. target = (self.TargetPart and FindFirstChild(charac, self.TargetPart)) or charac:FindFirstChild("HumanoidRootPart")
  575. --local pos, onscreen = WorldToViewportPoint(camera, target.Position)
  576. local g = self:GetClosestEdgeFromViewportPoint(mpos, target)
  577. if g then
  578.  
  579. local pos, onscreen = WorldToViewportPoint(camera, g)
  580. if onscreen and not self.Disabled then
  581. if self.Targets[plrz] then
  582. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.XSmoothingPercent * self.WidthFactor, self.YSmoothingPercent * self.WidthFactor)
  583. else
  584. if self.FlickSettings.Flick then
  585. relative = (Vector2.new(pos.X, pos.Y) - mpos) / Vector2.new(self.FlickSettings.FlickXSmoothingPercent * self.WidthFactor, self.FlickSettings.FlickYSmoothingPercent * self.WidthFactor)
  586. end
  587. end
  588. end
  589. end
  590. else
  591. if holding then
  592. holding = false
  593. mouse1release()
  594. end
  595.  
  596. mspoof = nil
  597. end
  598. else
  599. if holding then
  600. holding = false
  601. mouse1release()
  602. end
  603.  
  604. mspoof = nil
  605. end
  606. else
  607. if holding then
  608. holding = false
  609. mouse1release()
  610. end
  611.  
  612. mspoof = nil
  613. end
  614. end
  615. end)
  616. end
  617.  
  618. self.InputConnection = Connect(UserInputService.InputBegan, function(key)
  619. if self.Enabled and self.AutoPeak.Enabled and key.UserInputType == Enum.UserInputType.MouseButton3 then
  620. local root = LocalPlayer.Character and FindFirstChild(LocalPlayer.Character, "HumanoidRootPart")
  621.  
  622. if root then
  623. self.AutoPeak.PointPosition = not self.AutoPeak.PointPosition and root.Position or nil
  624. end
  625. end
  626. end)
  627.  
  628. local Players2 = game.GetService(game, "Players");
  629. local Client2 = Players2.LocalPlayer;
  630. local Mouse2 = Client2.GetMouse(Client2);
  631.  
  632. local old; old = hookmetamethod(game, "__index", newcclosure(function(i,v)
  633. if string.lower(v) == "hit" then
  634. if old(i, "ClassName") == "Mouse" or old(i, "ClassName") == "PlayerMouse" then
  635. if not checkcaller() then
  636. if mspoof then
  637. return CFrame.new(mspoof)
  638. end
  639. end
  640. end
  641. end
  642. return old(i,v)
  643. end))
  644.  
  645. local old2; old2 = hookmetamethod(game, "__namecall", newcclosure(function(self2, ...)
  646. if getnamecallmethod() == "ViewportPointToRay" and not checkcaller() and mspoof then
  647. local args = {...}
  648. local pos = GetMouseLocation(UserInputService)
  649. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  650. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  651. args[1] = newPos.X
  652. args[2] = newPos.Y
  653. return old2(self2, table.unpack(args))
  654. else
  655. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  656. local newPos = workspace.CurrentCamera.WorldToViewportPoint(workspace.CurrentCamera, mspoof)
  657. args[1] = newPos.X
  658. args[2] = newPos.Y
  659. return old2(self2, table.unpack(args))
  660. end
  661. end
  662. elseif getnamecallmethod() == "ScreenPointToRay" and not checkcaller() and mspoof then
  663. local args = {...}
  664. local pos = GetMouseLocation(UserInputService)
  665. if math.abs(args[1] - (pos.X + self.Offset.X)) <= 3 and math.abs(args[2] - (pos.Y + self.Offset.Y)) <= 3 then
  666. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  667. args[1] = newPos.X
  668. args[2] = newPos.Y
  669. return old2(self2, table.unpack(args))
  670. else
  671. if math.abs(args[1] - (Mouse2.X + self.Offset.X)) <= 3 and math.abs(args[2] - (Mouse2.Y + self.Offset.Y)) <= 3 then
  672. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  673. args[1] = newPos.X
  674. args[2] = newPos.Y
  675. return old2(self2, table.unpack(args))
  676. end
  677. end
  678. end
  679. return old2(self2, ...)
  680. end))
  681.  
  682. --[[
  683. local old2; old2 = hookmetamethod(game, "__namecall", function(self2, ...)
  684. local args = {...}
  685. if getnamecallmethod() == "ScreenPointToRay" or getnamecallmethod() == "ViewportPointToRay" and mspoof then
  686. local SecondPosition = game.GetService(game, "UserInputService").GetMouseLocation(game.GetService(game, "UserInputService"))
  687. if args[1] == Mouse2.X and args[2] == Mouse2.Y or args[1] == SecondPosition.X and args[2] == SecondPosition.Y then
  688. local newPos = workspace.CurrentCamera.WorldToScreenPoint(workspace.CurrentCamera, mspoof)
  689. args[1] = newPos.X
  690. args[2] = newPos.Y
  691. return old2(self2, table.unpack(args))
  692. end
  693. end
  694. return old2(self2, ...)
  695. end)
  696. --]]
  697. end
  698.  
  699. --//Completely kills aimbot, as opposed to enabled = false
  700. function Aimbot:Kill()
  701. self.Enabled = false
  702.  
  703. if self.RenderStep then
  704. Disconnect(self.RenderStep)
  705. self.RenderStep = nil
  706. end
  707.  
  708. if self.Heartbeat then
  709. Disconnect(self.Heartbeat)
  710. self.Heartbeat = nil
  711. end
  712.  
  713. if self.InputConnection then
  714. Disconnect(self.InputConnection)
  715. self.InputConnection = nil
  716. end
  717. end
  718.  
  719. --//Constructor
  720. function Aimbot.new(presets)
  721. presets = presets or {}
  722. UpdateTable(presets, Aimbot.DefaultSettings)
  723.  
  724. local WallCheckParams = RaycastParams.new()
  725. WallCheckParams.FilterType = Enum.RaycastFilterType.Blacklist
  726. WallCheckParams.IgnoreWater = presets.IgnoreWater
  727. WallCheckParams.FilterDescendantsInstances = presets.DefaultIgnore
  728.  
  729. presets.WallCheckParams = WallCheckParams
  730. return setmetatable(presets, Aimbot)
  731. end
  732.  
  733. --//Return with default settings
  734. return Aimbot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement