Advertisement
SekkayGod

sadwaad

Apr 20th, 2022
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. local Camera = workspace.CurrentCamera
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local UserInputService = game:GetService("UserInputService")
  5. local TweenService = game:GetService("TweenService")
  6. local LocalPlayer = Players.LocalPlayer
  7. local Holding = false
  8.  
  9. _G.AimbotEnabled = true
  10. _G.TeamCheck = false -- If set to true then the script would only lock your aim at enemy team members.
  11. _G.AimPart = "Head" -- Where the aimbot script would lock at.
  12. _G.Sensitivity = 0 -- How many seconds it takes for the aimbot script to officially lock onto the target's aimpart.
  13.  
  14. local function GetClosestPlayer()
  15. local MaximumDistance = math.huge
  16. local Target = nil
  17.  
  18. coroutine.wrap(function()
  19. wait(20); MaximumDistance = math.huge -- Reset the MaximumDistance so that the Aimbot doesn't remember it as a very small variable and stop capturing players...
  20. end)()
  21.  
  22. for _, v in next, Players:GetPlayers() do
  23. if v.Name ~= LocalPlayer.Name then
  24. if _G.TeamCheck == true then
  25. if v.Team ~= LocalPlayer.Team then
  26. if v.Character ~= nil then
  27. if v.Character:FindFirstChild("HumanoidRootPart") ~= nil then
  28. if v.Character:FindFirstChild("Humanoid") ~= nil and v.Character:FindFirstChild("Humanoid").Health ~= 0 then
  29. local ScreenPoint = Camera:WorldToScreenPoint(v.Character:WaitForChild("HumanoidRootPart", math.huge).Position)
  30. local VectorDistance = (Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y) - Vector2.new(ScreenPoint.X, ScreenPoint.Y)).Magnitude
  31.  
  32. if VectorDistance < MaximumDistance then
  33. Target = v
  34. MaximumDistance = VectorDistance
  35. end
  36. end
  37. end
  38. end
  39. end
  40. else
  41. if v.Character ~= nil then
  42. if v.Character:FindFirstChild("HumanoidRootPart") ~= nil then
  43. if v.Character:FindFirstChild("Humanoid") ~= nil and v.Character:FindFirstChild("Humanoid").Health ~= 0 then
  44. local ScreenPoint = Camera:WorldToScreenPoint(v.Character:WaitForChild("HumanoidRootPart", math.huge).Position)
  45. local VectorDistance = (Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y) - Vector2.new(ScreenPoint.X, ScreenPoint.Y)).Magnitude
  46.  
  47. if VectorDistance < MaximumDistance then
  48. Target = v
  49. MaximumDistance = VectorDistance
  50. end
  51. end
  52. end
  53. end
  54. end
  55. end
  56. end
  57.  
  58. return Target
  59. end
  60.  
  61. UserInputService.InputBegan:Connect(function(Input)
  62. if Input.UserInputType == Enum.UserInputType.MouseButton2 then
  63. Holding = true
  64. end
  65. end)
  66.  
  67. UserInputService.InputEnded:Connect(function(Input)
  68. if Input.UserInputType == Enum.UserInputType.MouseButton2 then
  69. Holding = false
  70. end
  71. end)
  72.  
  73. RunService.RenderStepped:Connect(function()
  74. if Holding == true and _G.AimbotEnabled == true then
  75. TweenService:Create(Camera, TweenInfo.new(_G.Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {CFrame = CFrame.new(Camera.CFrame.Position, GetClosestPlayer().Character[_G.AimPart].Position)}):Play()
  76. end
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement