0% found this document useful (0 votes)
224 views6 pages

Roblox Aimbot Script with ESP Features

The document is a Lua script for a Roblox game that implements an aimbot feature with various settings such as auto aim, ESP (Extra Sensory Perception), team checks, and wall checks. It includes a user interface with toggle buttons for these features, and allows players to aim at targets based on proximity and visibility. The script also handles drawing lines to targets and provides functionality for dragging the UI elements around the screen.

Uploaded by

dimtrytarasov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views6 pages

Roblox Aimbot Script with ESP Features

The document is a Lua script for a Roblox game that implements an aimbot feature with various settings such as auto aim, ESP (Extra Sensory Perception), team checks, and wall checks. It includes a user interface with toggle buttons for these features, and allows players to aim at targets based on proximity and visibility. The script also handles drawing lines to targets and provides functionality for dragging the UI elements around the screen.

Uploaded by

dimtrytarasov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--// Services

local Players = game:GetService("Players")


local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")

--// Variables
local player = [Link]
local camera = [Link]

local aiming = false


local espEnabled = false
local teamCheck = false
local wallCheck = false
local aimPart = "Head"
local lockToCenter = false
local drawLines = false

--// UI Setup
local screenGui = [Link]("ScreenGui")
[Link] = "AimbotUI"
[Link] = false
[Link] = true
[Link] = true
[Link] = player:WaitForChild("PlayerGui")

-- Gear Button
local gearButton = [Link]("ImageButton")
[Link] = [Link](0, 40, 0, 40)
[Link] = [Link](0.5, -20, 0.05, 0)
[Link] = 1
[Link] = "rbxassetid://6031091006"
[Link] = screenGui

-- Settings Menu
local menuFrame = [Link]("Frame")
[Link] = [Link](0, 220, 0, 360)
[Link] = [Link](0.5, -110, 0.5, -180)
menuFrame.BackgroundColor3 = [Link](40, 40, 40)
[Link] = 0
[Link] = false
[Link] = true
[Link] = screenGui

local uiList = [Link]("UIListLayout")


[Link] = menuFrame
[Link] = [Link](0, 6)
[Link] = [Link]
[Link] = [Link]

local function createToggleButton(text)


local button = [Link]("TextButton")
[Link] = [Link](0, 200, 0, 30)
button.BackgroundColor3 = [Link](60, 60, 60)
button.TextColor3 = [Link](1, 1, 1)
[Link] = [Link]
[Link] = 18
[Link] = text .. ": OFF"
[Link] = true
return button
end

-- Toggle Buttons
local aimToggle = createToggleButton("Auto Aim")
local espToggle = createToggleButton("ESP")
local teamCheckToggle = createToggleButton("Team Check")
local wallCheckToggle = createToggleButton("Wall Check")
local aimPartToggle = createToggleButton("Aim Part: Head")
local lockCenterToggle = createToggleButton("Lock To Screen Center")
local drawLinesToggle = createToggleButton("Draw Lines")

[Link] = menuFrame
[Link] = menuFrame
[Link] = menuFrame
[Link] = menuFrame
[Link] = menuFrame
[Link] = menuFrame
[Link] = menuFrame

-- Dragging Support
local function makeDraggable(guiElement)
local dragging = false
local dragInput, dragStart, startPos

[Link]:Connect(function(input)
if [Link] == [Link].MouseButton1 or
[Link] == [Link] then
dragging = true
dragStart = [Link]
startPos = [Link]

[Link]:Connect(function()
if [Link] == [Link] then
dragging = false
end
end)
end
end)

[Link]:Connect(function(input)
if [Link] == [Link] or
[Link] == [Link] then
dragInput = input
end
end)

[Link]:Connect(function(input)
if input == dragInput and dragging then
local delta = [Link] - dragStart
[Link] = [Link]([Link],
[Link] + delta.X, [Link], [Link] + delta.Y)
end
end)
end

makeDraggable(gearButton)
makeDraggable(menuFrame)
-- Gear Toggle
gearButton.MouseButton1Click:Connect(function()
[Link] = not [Link]
end)

-- Toggle Button Events


aimToggle.MouseButton1Click:Connect(function()
aiming = not aiming
[Link] = "Auto Aim: " .. (aiming and "ON" or "OFF")
end)

espToggle.MouseButton1Click:Connect(function()
espEnabled = not espEnabled
[Link] = "ESP: " .. (espEnabled and "ON" or "OFF")
end)

teamCheckToggle.MouseButton1Click:Connect(function()
teamCheck = not teamCheck
[Link] = "Team Check: " .. (teamCheck and "ON" or "OFF")
end)

wallCheckToggle.MouseButton1Click:Connect(function()
wallCheck = not wallCheck
[Link] = "Wall Check: " .. (wallCheck and "ON" or "OFF")
end)

aimPartToggle.MouseButton1Click:Connect(function()
aimPart = aimPart == "Head" and "HumanoidRootPart" or "Head"
[Link] = "Aim Part: " .. (aimPart == "Head" and "Head" or
"Torso")
end)

lockCenterToggle.MouseButton1Click:Connect(function()
lockToCenter = not lockToCenter
[Link] = "Lock To Screen Center: " .. (lockToCenter and "ON"
or "OFF")
end)

drawLinesToggle.MouseButton1Click:Connect(function()
drawLines = not drawLines
[Link] = "Draw Lines: " .. (drawLines and "ON" or "OFF")
end)

-- ESP
local espFolder = [Link]("Folder")
[Link] = "ESPFolder"
[Link] = screenGui

local espBoxes = {}

local function createESP(playerTarget)


local box = [Link]("BoxHandleAdornment")
[Link] = [Link](4, 6, 2)
[Link] = 0.8
box.Color3 = [Link](1, 1, 0)
[Link] = true
[Link] = 5
[Link] = [Link] and
[Link]:FindFirstChild("HumanoidRootPart")
[Link] = espFolder
return box
end

local function updateESP()


for plr, box in pairs(espBoxes) do
if plr and [Link] and
[Link]:FindFirstChild("HumanoidRootPart") then
[Link] = [Link]
if teamCheck and [Link] and [Link] then
box.Color3 = ([Link] == [Link]) and [Link](0, 0,
1) or [Link](1, 0, 0)
else
box.Color3 = [Link](1, 1, 0)
end
else
box:Destroy()
espBoxes[plr] = nil
end
end
end

-- Lines Drawing
local lineDrawer = [Link]("Line")
[Link] = [Link](1, 0, 0)
[Link] = 2
[Link] = 1
[Link] = false

-- Improved Wall Check


local function canSeeTarget(part)
if not wallCheck then return true end
local origin = [Link]
local direction = ([Link] - origin)
local rayParams = [Link]()
[Link] = {[Link]}
[Link] = [Link]
local raycastResult = Workspace:Raycast(origin, [Link] *
[Link], rayParams)
if raycastResult and [Link] and not
part:IsDescendantOf([Link]) then
return false
end
return true
end

-- Team Check based on damageability (simplified: consider same team if can't


damage)
local function isTeammate(target)
if not teamCheck then return false end
-- You can customize damage check here if you have a damage API
-- For now, use team equality
if [Link] and [Link] and [Link] == [Link] then
return true
end
return false
end

-- Get Target closest to center of screen


local function getTarget()
local myChar = [Link]
if not myChar then return nil end
local myHum = myChar:FindFirstChild("Humanoid")
if not myHum or [Link] <= 0 then return nil end

local closest = nil


local shortestDist = [Link]
local center2d = [Link]([Link].X/2,
[Link].Y/2)

for _, target in pairs(Players:GetPlayers()) do


if target ~= player and [Link] and
[Link]:FindFirstChild(aimPart) then
local part = [Link][aimPart]
local hum = [Link]:FindFirstChild("Humanoid")
if hum and [Link] > 0 then
if isTeammate(target) then
continue
end
if not canSeeTarget(part) then
continue
end

local screenPos, onScreen =


camera:WorldToViewportPoint([Link])
if not onScreen then
continue
end

local distFromCenter = ([Link](screenPos.X,


screenPos.Y) - center2d).Magnitude
if distFromCenter < shortestDist then
shortestDist = distFromCenter
closest = part
end
end
end
end

return closest
end

-- Aim at target part


local function aimAt(targetPart)
if targetPart then
[Link] = [Link]([Link], [Link])
end
end

-- Main loop
[Link]:Connect(function()
if espEnabled then
for _, plr in pairs(Players:GetPlayers()) do
if plr ~= player and not espBoxes[plr] then
espBoxes[plr] = createESP(plr)
end
end
updateESP()
else
for _, box in pairs(espBoxes) do
box:Destroy()
end
espBoxes = {}
end

local targetPart = nil


if aiming then
if lockToCenter then
targetPart = getTarget()
if targetPart then
aimAt(targetPart)
end
else
-- normal auto aim: closest target by distance from player
local myPos = [Link]
local closest = nil
local shortest = [Link]
for _, target in pairs(Players:GetPlayers()) do
if target ~= player and [Link] and
[Link]:FindFirstChild(aimPart) then
local part = [Link][aimPart]
local hum =
[Link]:FindFirstChild("Humanoid")
if hum and [Link] > 0 and not isTeammate(target)
and canSeeTarget(part) then
local dist = ([Link] - myPos).Magnitude
if dist < shortest then
shortest = dist
closest = part
end
end
end
end
if closest then
aimAt(closest)
end
end
end

-- Draw lines if enabled


if drawLines and aiming and targetPart then
local screenPos, onScreen =
camera:WorldToViewportPoint([Link])
if onScreen then
[Link] = [Link]([Link].X/2,
[Link].Y)
[Link] = [Link](screenPos.X, screenPos.Y)
[Link] = true
else
[Link] = false
end
else
[Link] = false
end
end)

You might also like