Advertisement
N04_h

Roblox arsenal aimbot script 2023

Jul 25th, 2023
2,645
2
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.69 KB | Cybersecurity | 2 0
  1. -- contact @n04_h on discord
  2. -- Smooth Aimbot for Roblox Arsenal with GUI and Lock-On
  3.  
  4. local Players = game:GetService("Players")
  5. local LocalPlayer = Players.LocalPlayer
  6. local UserInputService = game:GetService("UserInputService")
  7.  
  8. local LockOnTime = 0.7
  9. local AimbotEnabled = false
  10. local LastLockOnTime = 0
  11.  
  12. local function GetClosestPlayer()
  13.     local closestPlayer
  14.     local shortestDistance = math.huge
  15.  
  16.     for _, player in pairs(Players:GetPlayers()) do
  17.         if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 0 then
  18.             local distance = (player.Character.HumanoidRootPart.Position - LocalPlayer.Character.HumanoidRootPart.Position).magnitude
  19.             if distance < shortestDistance then
  20.                 closestPlayer = player
  21.                 shortestDistance = distance
  22.             end
  23.         end
  24.     end
  25.  
  26.     return closestPlayer
  27. end
  28.  
  29. local function SmoothAim(targetPart)
  30.     if targetPart then
  31.         local lookVector = (targetPart.Position - LocalPlayer.Character.Head.Position).unit
  32.         local angle = math.acos(lookVector:Dot(LocalPlayer.Character.Head.CFrame.lookVector))
  33.         if angle < math.rad(5) then -- Change the angle value for smoothness
  34.             -- Rotate the camera smoothly to the target
  35.             local mouse = LocalPlayer:GetMouse()
  36.             local currentLookVector = LocalPlayer.Character.Head.CFrame.lookVector
  37.             local newLookVector = (currentLookVector + lookVector * 0.1).unit
  38.             local newLookCFrame = CFrame.new(LocalPlayer.Character.Head.Position, LocalPlayer.Character.Head.Position + newLookVector)
  39.             mouse.Target = targetPart
  40.             mouse.TargetFilter = targetPart
  41.             LocalPlayer.Character.Head.CFrame = newLookCFrame
  42.         end
  43.     end
  44. end
  45.  
  46. local Gui = Instance.new("ScreenGui")
  47. Gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  48.  
  49. local Frame = Instance.new("Frame")
  50. Frame.Size = UDim2.new(0, 100, 0, 60)
  51. Frame.Position = UDim2.new(0.5, -50, 0.85, 0)
  52. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  53. Frame.BackgroundTransparency = 0.5
  54. Frame.BorderSizePixel = 0
  55. Frame.Parent = Gui
  56.  
  57. local TextLabel = Instance.new("TextLabel")
  58. TextLabel.Size = UDim2.new(1, 0, 0.5, 0)
  59. TextLabel.Text = "N4 Aimbot"
  60. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  61. TextLabel.TextSize = 14
  62. TextLabel.Parent = Frame
  63.  
  64. local ToggleButton = Instance.new("TextButton")
  65. ToggleButton.Size = UDim2.new(1, 0, 0.5, 0)
  66. ToggleButton.Position = UDim2.new(0, 0, 0.5, 0)
  67. ToggleButton.Text = "Aimbot: OFF"
  68. ToggleButton.TextColor3 = Color3.new(0, 0, 0)
  69. ToggleButton.TextSize = 14
  70. ToggleButton.Parent = Frame
  71.  
  72. ToggleButton.MouseButton1Click:Connect(function()
  73.     AimbotEnabled = not AimbotEnabled
  74.     if AimbotEnabled then
  75.         ToggleButton.Text = "Aimbot: ON"
  76.     else
  77.         ToggleButton.Text = "Aimbot: OFF"
  78.     end
  79. end)
  80.  
  81. UserInputService.InputBegan:Connect(function(input, isProcessed)
  82.     if AimbotEnabled and not isProcessed and input.UserInputType == Enum.UserInputType.MouseButton2 then
  83.         while UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) do
  84.             local currentTime = tick()
  85.             local targetPlayer = GetClosestPlayer()
  86.             if targetPlayer then
  87.                 local targetPart = targetPlayer.Character and targetPlayer.Character:FindFirstChild("Head")
  88.                 if targetPart then
  89.                     if currentTime - LastLockOnTime >= LockOnTime then
  90.                         LastLockOnTime = currentTime
  91.                         SmoothAim(targetPart)
  92.                     end
  93.                 end
  94.             end
  95.             wait()
  96.         end
  97.     end
  98. end)
  99.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement