SnapSan777

aimbot

May 21st, 2024
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. local Area = game:GetService("Workspace")
  2. local RunService = game:GetService("RunService")
  3. local UIS = game:GetService("UserInputService")
  4. local Players = game:GetService("Players")
  5. local CoreGui = game:GetService("CoreGui")
  6. local LocalPlayer = Players.LocalPlayer
  7. local Mouse = LocalPlayer:GetMouse()
  8. local MyView = Area.CurrentCamera
  9. local MyTeamColor = LocalPlayer.TeamColor
  10. local HoldingM2 = false
  11. local Active = false
  12. local Lock = false
  13. local Epitaph = 0.200 ---Note: The Bigger The Number, The More Prediction.
  14. local HeadOffset = Vector3.new(0, .1, 0)
  15.  
  16. _G.Character_Find_Method = 2
  17.  
  18. -- Method 1: Find nearest
  19. -- Method 2: Find nearest player to mouse
  20.  
  21. _G.TeamCheck = false
  22. _G.PredictUserMovement = true
  23. _G.FOV_Radius = 240
  24. _G.AimPart = "HumanoidRootPart"
  25.  
  26. local function CursorLock()
  27. UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
  28. end
  29.  
  30. local function UnLockCursor()
  31. HoldingM2 = false Active = false Lock = false
  32. UIS.MouseBehavior = Enum.MouseBehavior.Default
  33. end
  34.  
  35. function GetClosestPlayerToMouse()
  36. local target, mag = nil, _G.FOV_Radius
  37. for i,v in pairs(Players:GetPlayers()) do
  38. if not _G.TeamCheck then
  39. if v.Character and ((v.Character:FindFirstChild("Knife") ~= nil) or (v.Backpack and v.Backpack:FindFirstChild("Knife") ~= nil)) and v.Character:FindFirstChild(_G.AimPart) and v ~= LocalPlayer and v.Character:FindFirstChildOfClass("Humanoid").Health ~= 0 then
  40. local pos, onscreen = MyView:WorldToViewportPoint(v.Character[_G.AimPart].Position)
  41. if onscreen then
  42. local dist = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(pos.X, pos.Y)).Magnitude
  43. if dist < mag then
  44. target = v.Character
  45. mag = dist
  46. end
  47. end
  48. end
  49. end
  50. end
  51. return target
  52. end
  53.  
  54. UIS.InputBegan:Connect(function(Input)
  55. if Input.UserInputType == Enum.UserInputType.MouseButton2 then
  56. HoldingM2 = true
  57. Active = true
  58. Lock = true
  59. if Active then
  60. local The_Enemy = nil
  61. The_Enemy = GetClosestPlayerToMouse()
  62. while HoldingM2 do task.wait(.000001)
  63. if Lock and The_Enemy ~= nil then
  64. local Future = nil
  65. if _G.PredictUserMovement then
  66. Future = The_Enemy[_G.AimPart].CFrame + (The_Enemy[_G.AimPart].Velocity * Epitaph + HeadOffset)
  67. else
  68. Future = The_Enemy[_G.AimPart].CFrame
  69. end
  70. MyView.CFrame = CFrame.lookAt(MyView.CFrame.Position, Future.Position)
  71. CursorLock()
  72. end
  73. end
  74. end
  75. end
  76. end)
  77.  
  78. UIS.InputEnded:Connect(function(Input)
  79. if Input.UserInputType == Enum.UserInputType.MouseButton2 then
  80. UnLockCursor()
  81. end
  82. end)
  83.  
  84. UIS.InputBegan:Connect(function(input, gameProcessedEvent)
  85. if gameProcessedEvent then return end
  86. if input.UserInputType == Enum.UserInputType.Keyboard then
  87. if input.KeyCode == Enum.KeyCode.Z then
  88. _G.TeamCheck = not _G.TeamCheck
  89. _G.PredictUserMovement = not _G.PredictUserMovement
  90. game.StarterGui:SetCore("SendNotification", {
  91. Title = "Aimbot for Sheriff"; --the notifications
  92. Text = "Aimbot " ..tostring(not _G.TeamCheck);
  93. Duration = 2;
  94. })
  95. end
  96. if input.KeyCode == Enum.KeyCode.X then
  97. _G.PredictUserMovement = not _G.PredictUserMovement
  98. game.StarterGui:SetCore("SendNotification", {
  99. Title = "Aimbot"; --the notifications
  100. Text = "Predict movement: " ..tostring(_G.PredictUserMovement);
  101. Duration = 2;
  102. })
  103. end
  104. end
  105. end)
Advertisement
Add Comment
Please, Sign In to add comment