JackPackS

Aimbot

Jul 8th, 2021 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. local dwCamera = workspace.CurrentCamera
  2. local dwRunService = game:GetService("RunService")
  3. local dwUIS = game:GetService("UserInputService")
  4. local dwEntities = game:GetService("Players")
  5. local dwLocalPlayer = dwEntities.LocalPlayer
  6. local dwMouse = dwLocalPlayer:GetMouse()
  7.  
  8. local settings = {
  9. Aimbot = true,
  10. Aiming = false,
  11. Aimbot_AimPart = "Head",
  12. Aimbot_TeamCheck = true,
  13. Aimbot_Draw_FOV = true,
  14. Aimbot_FOV_Radius = 200,
  15. Aimbot_FOV_Color = Color3.fromRGB(255,255,255)
  16. }
  17.  
  18. local fovcircle = Drawing.new("Circle")
  19. fovcircle.Visible = settings.Aimbot_Draw_FOV
  20. fovcircle.Radius = settings.Aimbot_FOV_Radius
  21. fovcircle.Color = settings.Aimbot_FOV_Color
  22. fovcircle.Thickness = 1
  23. fovcircle.Filled = false
  24. fovcircle.Transparency = 1
  25.  
  26. fovcircle.Position = Vector2.new(dwCamera.ViewportSize.X / 2, dwCamera.ViewportSize.Y / 2)
  27.  
  28. dwUIS.InputBegan:Connect(function(i)
  29. if i.UserInputType == Enum.UserInputType.MouseButton2 then
  30. settings.Aiming = true
  31. end
  32. end)
  33.  
  34. dwUIS.InputEnded:Connect(function(i)
  35. if i.UserInputType == Enum.UserInputType.MouseButton2 then
  36. settings.Aiming = false
  37. end
  38. end)
  39.  
  40. dwRunService.RenderStepped:Connect(function()
  41.  
  42. local dist = math.huge
  43. local closest_char = nil
  44.  
  45. if settings.Aiming then
  46.  
  47. for i,v in next, dwEntities:GetChildren() do
  48.  
  49. if v ~= dwLocalPlayer and
  50. v.Character and
  51. v.Character:FindFirstChild("HumanoidRootPart") and
  52. v.Character:FindFirstChild("Humanoid") and
  53. v.Character:FindFirstChild("Humanoid").Health > 0 then
  54.  
  55. if settings.Aimbot_TeamCheck == true and
  56. v.Team ~= dwLocalPlayer.Team or
  57. settings.Aimbot_TeamCheck == false then
  58.  
  59. local char = v.Character
  60. local char_part_pos, is_onscreen = dwCamera:WorldToViewportPoint(char[settings.Aimbot_AimPart].Position)
  61.  
  62. if is_onscreen then
  63.  
  64. local mag = (Vector2.new(dwMouse.X, dwMouse.Y) - Vector2.new(char_part_pos.X, char_part_pos.Y)).Magnitude
  65.  
  66. if mag < dist and mag < settings.Aimbot_FOV_Radius then
  67.  
  68. dist = mag
  69. closest_char = char
  70.  
  71. end
  72. end
  73. end
  74. end
  75. end
  76.  
  77. if closest_char ~= nil and
  78. closest_char:FindFirstChild("HumanoidRootPart") and
  79. closest_char:FindFirstChild("Humanoid") and
  80. closest_char:FindFirstChild("Humanoid").Health > 0 then
  81.  
  82. dwCamera.CFrame = CFrame.new(dwCamera.CFrame.Position, closest_char[settings.Aimbot_AimPart].Position)
  83. end
  84. end
  85. end)
Add Comment
Please, Sign In to add comment