Advertisement
savedgenius

Street Shootout Aimbot Script

Nov 24th, 2024 (edited)
1,601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | Gaming | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local UserInputService = game:GetService("UserInputService")
  4.  
  5. local Camera = game.Workspace.CurrentCamera
  6. local AimPart = "Head" -- Always lock onto the head
  7. local FOV = 200 -- Field of View for aimbot targeting
  8. local BulletSpeed = 900 -- Adjust based on the weapon/projectile speed
  9. local Gravity = Vector3.new(0, -196.2, 0) -- Gravity vector
  10. local Smoothness = 0.1 -- Smoothness for camera adjustment
  11. local doubleClickThreshold = 0.25 -- Time to register a double right-click
  12.  
  13. _G.AimbotEnabled = false
  14.  
  15. local lastRightClickTime = 0
  16. local localPlayerTeam = Players.LocalPlayer.Team -- Store the initial team
  17. local teammates = {} -- Table to store teammates
  18.  
  19. -- Function to update the teammates list
  20. local function updateTeammates()
  21. teammates = {}
  22. for _, player in ipairs(Players:GetPlayers()) do
  23. if player.Team == localPlayerTeam and player ~= Players.LocalPlayer then
  24. table.insert(teammates, player)
  25. end
  26. end
  27. end
  28.  
  29. -- Function to calculate the closest player to the crosshair
  30. local function getClosestPlayer()
  31. local closestPlayer = nil
  32. local shortestDistance = FOV
  33.  
  34. for _, player in ipairs(Players:GetPlayers()) do
  35. -- Skip teammates
  36. if table.find(teammates, player) then
  37. continue
  38. end
  39.  
  40. -- Check if the player is valid and not the local player
  41. if player ~= Players.LocalPlayer and player.Character and player.Character:FindFirstChild(AimPart) then
  42. local part = player.Character[AimPart]
  43. local screenPosition, onScreen = Camera:WorldToViewportPoint(part.Position)
  44.  
  45. if onScreen then
  46. local mousePos = UserInputService:GetMouseLocation()
  47. local distance = (Vector2.new(screenPosition.X, screenPosition.Y) - mousePos).Magnitude
  48.  
  49. if distance < shortestDistance then
  50. closestPlayer = player
  51. shortestDistance = distance
  52. end
  53. end
  54. end
  55. end
  56.  
  57. return closestPlayer
  58. end
  59.  
  60. -- Function to calculate bullet prediction
  61. local function getPredictedPosition(targetPart, targetVelocity, distance)
  62. local travelTime = distance / BulletSpeed
  63. return targetPart.Position + (targetVelocity * travelTime)
  64. end
  65.  
  66. -- Monitor team changes dynamically
  67. RunService.Heartbeat:Connect(function()
  68. if Players.LocalPlayer.Team ~= localPlayerTeam then
  69. localPlayerTeam = Players.LocalPlayer.Team
  70. updateTeammates()
  71. print("Team updated, teammates refreshed.")
  72. end
  73. end)
  74.  
  75. -- Aimbot functionality
  76. RunService.RenderStepped:Connect(function()
  77. if _G.AimbotEnabled then
  78. local target = getClosestPlayer()
  79.  
  80. if target and target.Character and target.Character:FindFirstChild(AimPart) then
  81. local targetPart = target.Character[AimPart]
  82. local targetVelocity = target.Character:FindFirstChild("HumanoidRootPart") and target.Character.HumanoidRootPart.Velocity or Vector3.zero
  83. local distance = (Camera.CFrame.Position - targetPart.Position).Magnitude
  84.  
  85. -- Calculate predicted position
  86. local predictedPosition = getPredictedPosition(targetPart, targetVelocity, distance)
  87.  
  88. -- Smoothly adjust the camera to the predicted position
  89. local cameraDirection = Camera.CFrame.Position:Lerp(predictedPosition, Smoothness)
  90. Camera.CFrame = CFrame.new(Camera.CFrame.Position, cameraDirection)
  91. end
  92. end
  93. end)
  94.  
  95. -- Toggle Aimbot with Double-Right-Click
  96. UserInputService.InputBegan:Connect(function(input)
  97. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  98. local currentTime = tick()
  99. if currentTime - lastRightClickTime <= doubleClickThreshold then
  100. _G.AimbotEnabled = not _G.AimbotEnabled
  101. print("Aimbot Enabled:", _G.AimbotEnabled)
  102. end
  103. lastRightClickTime = currentTime
  104. end
  105. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement