Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- if player.LocaleId ~= "ru" then
- game.StarterGui:SetCore("SendNotification", {
- Title = "AimX has been Loaded!";
- Text = "AimX is loading in";
- Duration = 6;
- })
- end
- -- AimX Universal GUI Aimbot
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Workspace = game:GetService("Workspace")
- local Camera = workspace.CurrentCamera
- -- Settings
- local aimbotEnabled = false
- local aimKey = Enum.UserInputType.MouseButton2
- local teamCheck = true
- local wallCheck = false
- local smoothness = 1
- local aimFOV = 500
- local targetPart = "Head" -- default target
- local ignoreDead = true
- -- GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "AimXGUI"
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0,320,0,300)
- frame.Position = UDim2.new(0.5,-160,0.5,-150)
- frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
- frame.Visible = true
- frame.Parent = screenGui
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0,12)
- corner.Parent = frame
- -- Top bar
- local topBar = Instance.new("Frame")
- topBar.Size = UDim2.new(1,0,0,30)
- topBar.BackgroundColor3 = Color3.fromRGB(20,20,20)
- topBar.Parent = frame
- local topCorner = Instance.new("UICorner")
- topCorner.CornerRadius = UDim.new(0,12)
- topCorner.Parent = topBar
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1,0,1,0)
- title.BackgroundTransparency = 1
- title.Text = "AimX"
- title.TextColor3 = Color3.new(1,1,1)
- title.Font = Enum.Font.SourceSansBold
- title.TextScaled = true
- title.Parent = topBar
- -- Close button
- local closeBtn = Instance.new("TextButton")
- closeBtn.Size = UDim2.new(0,25,0,25)
- closeBtn.Position = UDim2.new(1,-30,0,2)
- closeBtn.Text = "X"
- closeBtn.Font = Enum.Font.SourceSansBold
- closeBtn.TextColor3 = Color3.new(1,0,0)
- closeBtn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- closeBtn.Parent = topBar
- local closeCorner = Instance.new("UICorner")
- closeCorner.CornerRadius = UDim.new(0,5)
- closeCorner.Parent = closeBtn
- closeBtn.MouseButton1Click:Connect(function()
- screenGui:Destroy()
- end)
- -- Minimize button
- local minBtn = Instance.new("TextButton")
- minBtn.Size = UDim2.new(0,25,0,25)
- minBtn.Position = UDim2.new(1,-60,0,2)
- minBtn.Text = "-"
- minBtn.Font = Enum.Font.SourceSansBold
- minBtn.TextColor3 = Color3.new(1,1,0)
- minBtn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- minBtn.Parent = topBar
- local minCorner = Instance.new("UICorner")
- minCorner.CornerRadius = UDim.new(0,5)
- minCorner.Parent = minBtn
- -- Minimized circle button
- local miniBtn = Instance.new("TextButton")
- miniBtn.Size = UDim2.new(0,70,0,70)
- miniBtn.Position = UDim2.new(0.5,-35,0.5,-35)
- miniBtn.Text = "AX"
- miniBtn.Font = Enum.Font.SourceSansBold
- miniBtn.TextColor3 = Color3.new(1,1,1)
- miniBtn.BackgroundColor3 = Color3.fromRGB(30,30,30)
- miniBtn.Visible = false
- miniBtn.Parent = screenGui
- local miniCorner = Instance.new("UICorner")
- miniCorner.CornerRadius = UDim.new(1,0)
- miniCorner.Parent = miniBtn
- minBtn.MouseButton1Click:Connect(function()
- frame.Visible=false
- miniBtn.Visible=true
- end)
- miniBtn.MouseButton1Click:Connect(function()
- frame.Visible=true
- miniBtn.Visible=false
- end)
- -- Move main GUI
- local dragging, dragOffset = false, Vector2.new()
- topBar.InputBegan:Connect(function(input)
- if input.UserInputType==Enum.UserInputType.MouseButton1 then
- dragging=true
- dragOffset = input.Position - frame.AbsolutePosition
- end
- end)
- topBar.InputEnded:Connect(function(input)
- if input.UserInputType==Enum.UserInputType.MouseButton1 then dragging=false end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and input.UserInputType==Enum.UserInputType.MouseMovement then
- frame.Position = UDim2.new(0,input.Position.X-dragOffset.X,0,input.Position.Y-dragOffset.Y)
- end
- end)
- -- Move minimized button
- local miniDragging, miniOffset = false, Vector2.new()
- miniBtn.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- miniDragging = true
- miniOffset = input.Position - miniBtn.AbsolutePosition
- end
- end)
- miniBtn.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- miniDragging = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if miniDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- miniBtn.Position = UDim2.new(0, input.Position.X - miniOffset.X, 0, input.Position.Y - miniOffset.Y)
- end
- end)
- -- Helper function to create toggles
- local function createToggle(text,posY,state)
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.new(0,280,0,30)
- btn.Position = UDim2.new(0,20,0,posY)
- btn.Text = text..": "..(state and "ON" or "OFF")
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Font = Enum.Font.SourceSansBold
- btn.TextScaled = true
- btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
- btn.Parent = frame
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0,6)
- corner.Parent = btn
- return btn
- end
- -- Toggles
- local aimbotBtn = createToggle("Aimbot",50,aimbotEnabled)
- local teamBtn = createToggle("TeamCheck",90,teamCheck)
- local wallBtn = createToggle("WallCheck",130,wallCheck)
- -- Smoothness input
- local smoothBox = Instance.new("TextBox")
- smoothBox.Size = UDim2.new(0,280,0,30)
- smoothBox.Position = UDim2.new(0,20,0,170)
- smoothBox.Text = tostring(smoothness)
- smoothBox.TextScaled = true
- smoothBox.BackgroundColor3 = Color3.fromRGB(50,50,50)
- smoothBox.TextColor3 = Color3.new(1,1,1)
- smoothBox.Parent = frame
- -- FOV input
- local fovBox = Instance.new("TextBox")
- fovBox.Size = UDim2.new(0,280,0,30)
- fovBox.Position = UDim2.new(0,20,0,210)
- fovBox.Text = tostring(aimFOV)
- fovBox.TextScaled = true
- fovBox.BackgroundColor3 = Color3.fromRGB(50,50,50)
- fovBox.TextColor3 = Color3.new(1,1,1)
- fovBox.Parent = frame
- -- Target part input
- local targetBox = Instance.new("TextBox")
- targetBox.Size = UDim2.new(0,280,0,30)
- targetBox.Position = UDim2.new(0,20,0,250)
- targetBox.PlaceholderText = "Target Part (Head/UpperTorso/Chest)"
- targetBox.TextScaled = true
- targetBox.BackgroundColor3 = Color3.fromRGB(50,50,50)
- targetBox.TextColor3 = Color3.new(1,1,1)
- targetBox.Parent = frame
- targetBox.FocusLost:Connect(function()
- local val = targetBox.Text
- if val ~= "" then
- targetPart = val
- end
- end)
- -- Toggle logic
- aimbotBtn.MouseButton1Click:Connect(function()
- aimbotEnabled = not aimbotEnabled
- aimbotBtn.Text = "Aimbot: "..(aimbotEnabled and "ON" or "OFF")
- end)
- teamBtn.MouseButton1Click:Connect(function()
- teamCheck = not teamCheck
- teamBtn.Text = "TeamCheck: "..(teamCheck and "ON" or "OFF")
- end)
- wallBtn.MouseButton1Click:Connect(function()
- wallCheck = not wallCheck
- wallBtn.Text = "WallCheck: "..(wallCheck and "ON" or "OFF")
- end)
- smoothBox.FocusLost:Connect(function()
- local val = tonumber(smoothBox.Text)
- if val then smoothness = math.clamp(val,0.01,5) smoothBox.Text=tostring(smoothness) end
- end)
- fovBox.FocusLost:Connect(function()
- local val = tonumber(fovBox.Text)
- if val then aimFOV = math.clamp(val,50,2000) fovBox.Text=tostring(aimFOV) end
- end)
- -- FOV Circle overlay
- local fovCircle = Drawing.new("Circle")
- fovCircle.Radius = aimFOV
- fovCircle.Color = Color3.fromRGB(255,255,0)
- fovCircle.Thickness = 2
- fovCircle.Transparency = 0.5
- fovCircle.Visible = true
- RunService.RenderStepped:Connect(function()
- local mousePos = UserInputService:GetMouseLocation()
- fovCircle.Position = Vector2.new(mousePos.X,mousePos.Y)
- fovCircle.Radius = aimFOV
- end)
- -- Visibility check
- local function isVisible(target)
- if not wallCheck then return true end
- local part = target.Character:FindFirstChild(targetPart)
- if not part then return false end
- local ray = Ray.new(Camera.CFrame.Position,(part.Position-Camera.CFrame.Position).Unit*1000)
- local hitPart = Workspace:FindPartOnRayWithIgnoreList(ray,{LocalPlayer.Character},false,true)
- if hitPart and hitPart:IsDescendantOf(target.Character) then return true end
- return false
- end
- -- Find closest target
- local function getClosestTarget()
- local closestPlayer
- local closestDist = aimFOV
- local mousePos = UserInputService:GetMouseLocation()
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild(targetPart) then
- if teamCheck and player.Team == LocalPlayer.Team then continue end
- if ignoreDead and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health <= 0 then continue end
- if not isVisible(player) then continue end
- local partPos, onScreen = Camera:WorldToViewportPoint(player.Character[targetPart].Position)
- if onScreen then
- local dist = (Vector2.new(partPos.X,partPos.Y)-Vector2.new(mousePos.X,mousePos.Y)).Magnitude
- if dist<closestDist then
- closestDist=dist
- closestPlayer=player
- end
- end
- end
- end
- return closestPlayer
- end
- -- Aimbot loop
- RunService.RenderStepped:Connect(function()
- if aimbotEnabled and UserInputService:IsMouseButtonPressed(aimKey) then
- local target = getClosestTarget()
- if target and target.Character and target.Character:FindFirstChild(targetPart) then
- local partPos = target.Character[targetPart].Position
- Camera.CFrame = Camera.CFrame:Lerp(CFrame.new(Camera.CFrame.Position,partPos), smoothness)
- end
- end
- end)
Advertisement