Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Area = game:GetService("Workspace")
- local RunService = game:GetService("RunService")
- local UIS = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local CoreGui = game:GetService("CoreGui")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local MyView = Area.CurrentCamera
- local MyTeamColor = LocalPlayer.TeamColor
- local HoldingM2 = false
- local Active = false
- local Lock = false
- local Epitaph = 0.200 ---Note: The Bigger The Number, The More Prediction.
- local HeadOffset = Vector3.new(0, .1, 0)
- _G.Character_Find_Method = 2
- -- Method 1: Find nearest
- -- Method 2: Find nearest player to mouse
- _G.TeamCheck = false
- _G.PredictUserMovement = true
- _G.FOV_Radius = 240
- _G.AimPart = "HumanoidRootPart"
- local function CursorLock()
- UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
- end
- local function UnLockCursor()
- HoldingM2 = false Active = false Lock = false
- UIS.MouseBehavior = Enum.MouseBehavior.Default
- end
- function GetClosestPlayerToMouse()
- local target, mag = nil, _G.FOV_Radius
- for i,v in pairs(Players:GetPlayers()) do
- if not _G.TeamCheck then
- 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
- local pos, onscreen = MyView:WorldToViewportPoint(v.Character[_G.AimPart].Position)
- if onscreen then
- local dist = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(pos.X, pos.Y)).Magnitude
- if dist < mag then
- target = v.Character
- mag = dist
- end
- end
- end
- end
- end
- return target
- end
- UIS.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton2 then
- HoldingM2 = true
- Active = true
- Lock = true
- if Active then
- local The_Enemy = nil
- The_Enemy = GetClosestPlayerToMouse()
- while HoldingM2 do task.wait(.000001)
- if Lock and The_Enemy ~= nil then
- local Future = nil
- if _G.PredictUserMovement then
- Future = The_Enemy[_G.AimPart].CFrame + (The_Enemy[_G.AimPart].Velocity * Epitaph + HeadOffset)
- else
- Future = The_Enemy[_G.AimPart].CFrame
- end
- MyView.CFrame = CFrame.lookAt(MyView.CFrame.Position, Future.Position)
- CursorLock()
- end
- end
- end
- end
- end)
- UIS.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton2 then
- UnLockCursor()
- end
- end)
- UIS.InputBegan:Connect(function(input, gameProcessedEvent)
- if gameProcessedEvent then return end
- if input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.Z then
- _G.TeamCheck = not _G.TeamCheck
- _G.PredictUserMovement = not _G.PredictUserMovement
- game.StarterGui:SetCore("SendNotification", {
- Title = "Aimbot for Sheriff"; --the notifications
- Text = "Aimbot " ..tostring(not _G.TeamCheck);
- Duration = 2;
- })
- end
- if input.KeyCode == Enum.KeyCode.X then
- _G.PredictUserMovement = not _G.PredictUserMovement
- game.StarterGui:SetCore("SendNotification", {
- Title = "Aimbot"; --the notifications
- Text = "Predict movement: " ..tostring(_G.PredictUserMovement);
- Duration = 2;
- })
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment