hackedprofile

EzAimbot

Jan 23rd, 2021
879
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local TeamCheck = true
  2. local WallCheck = true
  3. local Key = "E"
  4. local BodyPart = "Head"
  5. local FOV = 1000
  6. local Inset = game:GetService("GuiService"):GetGuiInset()
  7. local SC = Vector2.new(workspace.CurrentCamera.ViewportSize.X / 2, workspace.CurrentCamera.ViewportSize.Y / 2)
  8. local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
  9. if string.len(Key) == 1 then
  10.     Key = string.upper(Key)
  11. end
  12. function NotObstructing(Destination, Ignore)
  13.     local Origin = workspace.CurrentCamera.CFrame.Position
  14.     local CheckRay = Ray.new(Origin, Destination - Origin)
  15.     local Hit = workspace:FindPartOnRayWithIgnoreList(CheckRay, Ignore)
  16.     return Hit == nil
  17. end
  18. function ClosestHoe()
  19.     local MaxDist, Nearest = math.huge
  20.     for I,V in pairs(game:GetService("Players"):GetPlayers()) do
  21.         if V ~= game:GetService("Players").LocalPlayer and V.Character and V.Character:FindFirstChild("Humanoid") then
  22.             if WallCheck then
  23.                 if TeamCheck then
  24.                     if V.Team ~= game:GetService("Players").LocalPlayer.Team then
  25.                         local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(V.Character[BodyPart].Position)
  26.                         if Vis and NotObstructing(V.Character[BodyPart].Position, {game:GetService("Players").LocalPlayer.Character, V.Character}) then
  27.                             local Diff = math.sqrt((Pos.X - SC.X) ^ 2 + (Pos.Y + Inset.Y - SC.Y) ^ 2)
  28.                             if Diff < MaxDist and Diff < FOV then
  29.                                 MaxDist = Diff
  30.                                 Nearest = V
  31.                             end
  32.                         end
  33.                     end
  34.                 else
  35.                     local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(V.Character[BodyPart].Position)
  36.                     if Vis and NotObstructing(V.Character[BodyPart].Position, {game:GetService("Players").LocalPlayer.Character, V.Character}) then
  37.                         local Diff = math.sqrt((Pos.X - SC.X) ^ 2 + (Pos.Y + Inset.Y - SC.Y) ^ 2)
  38.                         if Diff < MaxDist and Diff < FOV then
  39.                             MaxDist = Diff
  40.                             Nearest = V
  41.                         end
  42.                     end
  43.                 end
  44.             else
  45.                 if TeamCheck then
  46.                     if V.Team ~= game:GetService("Players").LocalPlayer.Team then
  47.                         local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(V.Character[BodyPart].Position)
  48.                         if Vis then
  49.                             local Diff = math.sqrt((Pos.X - SC.X) ^ 2 + (Pos.Y + Inset.Y - SC.Y) ^ 2)
  50.                             if Diff < MaxDist and Diff < FOV then
  51.                                 MaxDist = Diff
  52.                                 Nearest = V
  53.                             end
  54.                         end
  55.                     end
  56.                 else
  57.                     local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(V.Character[BodyPart].Position)
  58.                     if Vis then
  59.                         local Diff = math.sqrt((Pos.X - SC.X) ^ 2 + (Pos.Y + Inset.Y - SC.Y) ^ 2)
  60.                         if Diff < MaxDist and Diff < FOV then
  61.                             MaxDist = Diff
  62.                             Nearest = V
  63.                         end
  64.                     end
  65.                 end
  66.             end
  67.         end
  68.     end
  69.     return Nearest
  70. end
  71.  
  72. game:GetService("RunService").RenderStepped:Connect(function()
  73.     if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode[Key]) then
  74.         local Hoe = ClosestHoe()
  75.         if Hoe and Hoe.Character and Hoe.Character:FindFirstChild(BodyPart) then
  76.             local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(Hoe.Character[BodyPart].Position)
  77.             if Vis then
  78.                 mousemoverel(Pos.X - Mouse.X, Pos.Y - Mouse.Y)
  79.             end
  80.         end
  81.     end
  82. end)
RAW Paste Data