Newplayer900

Prison Life Aimbot

Nov 12th, 2022
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. local Players = game.Players
  2. local LocalPlayer = Players.LocalPlayer
  3. local GetPlayers = Players.GetPlayers
  4. local Camera = workspace.CurrentCamera
  5. local WTSP = Camera.WorldToScreenPoint
  6. local FindFirstChild = game.FindFirstChild
  7. local Vector2_new = Vector2.new
  8. local Mouse = LocalPlayer.GetMouse(LocalPlayer)
  9. function ClosestChar()
  10. local Max, Close = math.huge
  11. for I,V in pairs(GetPlayers(Players)) do
  12. if V ~= LocalPlayer and V.Team ~= LocalPlayer.Team and V.Character then
  13. local Head = FindFirstChild(V.Character, "Head")
  14. if Head then
  15. local Pos, OnScreen = WTSP(Camera, Head.Position)
  16. if OnScreen then
  17. local Dist = (Vector2_new(Pos.X, Pos.Y) - Vector2_new(Mouse.X, Mouse.Y)).Magnitude
  18. if Dist < Max then
  19. Max = Dist
  20. Close = V.Character
  21. end
  22. end
  23. end
  24. end
  25. end
  26. return Close
  27. end
  28.  
  29. local MT = getrawmetatable(game)
  30. local __namecall = MT.__namecall
  31. setreadonly(MT, false)
  32. MT.__namecall = newcclosure(function(self, ...)
  33. local Method = getnamecallmethod()
  34. if Method == "FindPartOnRay" and not checkcaller() and tostring(getfenv(0).script) == "GunInterface" then
  35. local Character = ClosestChar()
  36. if Character then
  37. return Character.Head, Character.Head.Position
  38. end
  39. end
  40.  
  41. return __namecall(self, ...)
  42. end)
  43. setreadonly(MT, true)
  44.  
Add Comment
Please, Sign In to add comment