Advertisement
ViperSoftware

Street Shootout Viper.gg V1.1

Nov 16th, 2024 (edited)
1,527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.25 KB | None | 0 0
  1. local script = [[
  2. -- Global Toggles
  3. _G.ESPEnabled = true -- Toggle ESP on/off
  4. _G.AimbotEnabled = true -- Toggle Aimbot on/off
  5.  
  6. -- Services
  7. local Players = game:GetService("Players")
  8. local RunService = game:GetService("RunService")
  9. local UserInputService = game:GetService("UserInputService")
  10. local Camera = game.Workspace.CurrentCamera
  11.  
  12. -- Settings
  13. local FOV = 100 -- Field of View for aimbot targeting
  14. local Smoothness = 0.2 -- Controls how smooth the aimbot is (lower is faster)
  15. local AimPart = "Head" -- Body part to aim at (e.g., "Head", "Torso")
  16. local BulletSpeed = 1000 -- Bullet travel speed (game-specific)
  17. local Gravity = Vector3.new(0, -196.2, 0) -- Gravity, typically Roblox standard
  18.  
  19. -- Store all ESP highlights for cleanup
  20. local ESPInstances = {}
  21.  
  22. -- Function to create ESP
  23. local function addESP(player)
  24.     if not _G.ESPEnabled then return end
  25.  
  26.     -- Ensure the player has a character
  27.     if player ~= Players.LocalPlayer and player.Character then
  28.         local highlight = Instance.new("Highlight")
  29.         highlight.Adornee = player.Character
  30.         highlight.Parent = player.Character
  31.         highlight.FillColor = Color3.new(1, 0, 0) -- Red for enemies
  32.         highlight.OutlineColor = Color3.new(1, 1, 1) -- White outline
  33.         highlight.FillTransparency = 0.5
  34.         highlight.OutlineTransparency = 0
  35.  
  36.         -- Store for cleanup
  37.         ESPInstances[player] = highlight
  38.     end
  39. end
  40.  
  41. -- Cleanup ESP for a player
  42. local function removeESP(player)
  43.     if ESPInstances[player] then
  44.         ESPInstances[player]:Destroy()
  45.         ESPInstances[player] = nil
  46.     end
  47. end
  48.  
  49. -- Add ESP for all current players
  50. for _, player in ipairs(Players:GetPlayers()) do
  51.     if player.Character then
  52.         addESP(player)
  53.     end
  54.  
  55.     -- Listen for respawn (CharacterAdded)
  56.     player.CharacterAdded:Connect(function()
  57.         if _G.ESPEnabled then
  58.             wait(0.1) -- Small delay to ensure character is fully loaded
  59.             removeESP(player) -- Clean up any existing ESP
  60.             addESP(player) -- Reapply ESP
  61.         end
  62.     end)
  63. end
  64.  
  65. -- Add ESP for new players
  66. Players.PlayerAdded:Connect(function(player)
  67.     player.CharacterAdded:Connect(function()
  68.         if _G.ESPEnabled then
  69.             wait(0.1) -- Small delay to ensure character is fully loaded
  70.             addESP(player)
  71.         end
  72.     end)
  73. end)
  74.  
  75. -- Monitor Kill Switch (Optional Cleanup)
  76. RunService.Heartbeat:Connect(function()
  77.     if not _G.ESPEnabled then
  78.         -- Destroy all ESP highlights and clear the table
  79.         for _, instance in pairs(ESPInstances) do
  80.             if instance and instance.Parent then
  81.                 instance:Destroy()
  82.             end
  83.         end
  84.         ESPInstances = {}
  85.         print("ESP Disabled and Cleaned Up")
  86.     end
  87. end)
  88.  
  89. -- Function to calculate the closest player to the crosshair
  90. local function getClosestPlayer()
  91.     local closestPlayer = nil
  92.     local shortestDistance = FOV
  93.  
  94.     for _, player in ipairs(Players:GetPlayers()) do
  95.         if player ~= Players.LocalPlayer and player.Character and player.Character:FindFirstChild(AimPart) then
  96.             local part = player.Character[AimPart]
  97.             local screenPosition, onScreen = Camera:WorldToViewportPoint(part.Position)
  98.  
  99.             if onScreen then
  100.                 local mousePos = UserInputService:GetMouseLocation()
  101.                 local distance = (Vector2.new(screenPosition.X, screenPosition.Y) - mousePos).Magnitude
  102.  
  103.                 if distance < shortestDistance then
  104.                     closestPlayer = player
  105.                     shortestDistance = distance
  106.                 end
  107.             end
  108.         end
  109.     end
  110.  
  111.     return closestPlayer
  112. end
  113.  
  114. -- Function to calculate bullet prediction
  115. local function getPredictedPosition(targetPart, targetVelocity, distance)
  116.     local travelTime = distance / BulletSpeed
  117.  
  118.     -- Predict future position based on velocity and gravity
  119.     local futurePosition = targetPart.Position + (targetVelocity * travelTime) + (0.5 * Gravity * travelTime^2)
  120.     return futurePosition
  121. end
  122.  
  123. -- Aimbot Functionality
  124. RunService.RenderStepped:Connect(function()
  125.     if _G.AimbotEnabled then
  126.         local target = getClosestPlayer()
  127.  
  128.         if target and target.Character and target.Character:FindFirstChild(AimPart) then
  129.             local targetPart = target.Character[AimPart]
  130.             local targetVelocity = target.Character:FindFirstChild("HumanoidRootPart") and target.Character.HumanoidRootPart.Velocity or Vector3.zero
  131.             local distance = (Camera.CFrame.Position - targetPart.Position).Magnitude
  132.  
  133.             -- Calculate predicted position
  134.             local predictedPosition = getPredictedPosition(targetPart, targetVelocity, distance)
  135.  
  136.             -- Smoothly adjust the camera to the predicted position
  137.             local cameraDirection = Camera.CFrame.Position:Lerp(predictedPosition, Smoothness)
  138.             Camera.CFrame = CFrame.new(Camera.CFrame.Position, cameraDirection)
  139.         end
  140.     end
  141. end)
  142.  
  143. -- Toggle Aimbot with a Hotkey (e.g., "F")
  144. UserInputService.InputBegan:Connect(function(input)
  145.     if input.KeyCode == Enum.KeyCode.F then
  146.         _G.AimbotEnabled = not _G.AimbotEnabled
  147.         print("Aimbot Enabled:", _G.AimbotEnabled)
  148.     end
  149. end)
  150. ]]
  151.  
  152. loadstring(script)()
  153.  
Tags: Roblox Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement