Advertisement
vl_accurxte

Silent AIM [Open Source]

Dec 15th, 2020
29,602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. local CurrentCamera = workspace.CurrentCamera
  2. local Players = game.Players
  3. local LocalPlayer = Players.LocalPlayer
  4. local Mouse = LocalPlayer:GetMouse()
  5. function ClosestPlayer()
  6. local MaxDist, Closest = math.huge
  7. for I,V in pairs(Players.GetPlayers(Players)) do
  8. if V == LocalPlayer then continue end
  9. if V.Team == LocalPlayer then continue end
  10. if not V.Character then continue end
  11. local Head = V.Character.FindFirstChild(V.Character, "Head")
  12. if not Head then continue end
  13. local Pos, Vis = CurrentCamera.WorldToScreenPoint(CurrentCamera, Head.Position)
  14. if not Vis then continue end
  15. local MousePos, TheirPos = Vector2.new(Mouse.X, Mouse.Y), Vector2.new(Pos.X, Pos.Y)
  16. local Dist = (TheirPos - MousePos).Magnitude
  17. if Dist < MaxDist then
  18. MaxDist = Dist
  19. Closest = V
  20. end
  21. end
  22. return Closest
  23. end
  24. local MT = getrawmetatable(game)
  25. local OldNC = MT.__namecall
  26. local OldIDX = MT.__index
  27. setreadonly(MT, false)
  28. MT.__namecall = newcclosure(function(self, ...)
  29. local Args, Method = {...}, getnamecallmethod()
  30. if Method == "FindPartOnRayWithIgnoreList" and not checkcaller() then
  31. local CP = ClosestPlayer()
  32. if CP and CP.Character and CP.Character.FindFirstChild(CP.Character, "Head") then
  33. Args[1] = Ray.new(CurrentCamera.CFrame.Position, (CP.Character.Head.Position - CurrentCamera.CFrame.Position).Unit * 1000)
  34. return OldNC(self, unpack(Args))
  35. end
  36. end
  37. return OldNC(self, ...)
  38. end)
  39. MT.__index = newcclosure(function(self, K)
  40. if K == "Clips" then
  41. return workspace.Map
  42. end
  43. return OldIDX(self, K)
  44. end)
  45. setreadonly(MT, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement