Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- contact @n04_h on discord
- -- Smooth Aimbot for Roblox Arsenal with GUI and Lock-On
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local UserInputService = game:GetService("UserInputService")
- local LockOnTime = 0.7
- local AimbotEnabled = false
- local LastLockOnTime = 0
- local function GetClosestPlayer()
- local closestPlayer
- local shortestDistance = math.huge
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 0 then
- local distance = (player.Character.HumanoidRootPart.Position - LocalPlayer.Character.HumanoidRootPart.Position).magnitude
- if distance < shortestDistance then
- closestPlayer = player
- shortestDistance = distance
- end
- end
- end
- return closestPlayer
- end
- local function SmoothAim(targetPart)
- if targetPart then
- local lookVector = (targetPart.Position - LocalPlayer.Character.Head.Position).unit
- local angle = math.acos(lookVector:Dot(LocalPlayer.Character.Head.CFrame.lookVector))
- if angle < math.rad(5) then -- Change the angle value for smoothness
- -- Rotate the camera smoothly to the target
- local mouse = LocalPlayer:GetMouse()
- local currentLookVector = LocalPlayer.Character.Head.CFrame.lookVector
- local newLookVector = (currentLookVector + lookVector * 0.1).unit
- local newLookCFrame = CFrame.new(LocalPlayer.Character.Head.Position, LocalPlayer.Character.Head.Position + newLookVector)
- mouse.Target = targetPart
- mouse.TargetFilter = targetPart
- LocalPlayer.Character.Head.CFrame = newLookCFrame
- end
- end
- end
- local Gui = Instance.new("ScreenGui")
- Gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0, 100, 0, 60)
- Frame.Position = UDim2.new(0.5, -50, 0.85, 0)
- Frame.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame.BackgroundTransparency = 0.5
- Frame.BorderSizePixel = 0
- Frame.Parent = Gui
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Size = UDim2.new(1, 0, 0.5, 0)
- TextLabel.Text = "N4 Aimbot"
- TextLabel.TextColor3 = Color3.new(0, 0, 0)
- TextLabel.TextSize = 14
- TextLabel.Parent = Frame
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Size = UDim2.new(1, 0, 0.5, 0)
- ToggleButton.Position = UDim2.new(0, 0, 0.5, 0)
- ToggleButton.Text = "Aimbot: OFF"
- ToggleButton.TextColor3 = Color3.new(0, 0, 0)
- ToggleButton.TextSize = 14
- ToggleButton.Parent = Frame
- ToggleButton.MouseButton1Click:Connect(function()
- AimbotEnabled = not AimbotEnabled
- if AimbotEnabled then
- ToggleButton.Text = "Aimbot: ON"
- else
- ToggleButton.Text = "Aimbot: OFF"
- end
- end)
- UserInputService.InputBegan:Connect(function(input, isProcessed)
- if AimbotEnabled and not isProcessed and input.UserInputType == Enum.UserInputType.MouseButton2 then
- while UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) do
- local currentTime = tick()
- local targetPlayer = GetClosestPlayer()
- if targetPlayer then
- local targetPart = targetPlayer.Character and targetPlayer.Character:FindFirstChild("Head")
- if targetPart then
- if currentTime - LastLockOnTime >= LockOnTime then
- LastLockOnTime = currentTime
- SmoothAim(targetPart)
- end
- end
- end
- wait()
- end
- end
- end)
Advertisement
Advertisement