
Key RequiredUniversal

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer
local Camera = Workspace.CurrentCamera
local ESPData = {}
local UIElements = {}
local Running = true
local LastFrameTime = tick()
local FPS = 60
local RainbowHue = 0
local Config = {
SpeedEnabled = false,
SpeedValue = 16,
TriggerBotEnabled = false,
TeamCheckEnabled = true,
LocalPlayerESP = false,
RainbowESP = false
}
local Connections = {}
local function HSVToRGB(h, s, v)
local c = v * s
local x = c * (1 - math.abs((h / 60) % 2 - 1))
local m = v - c
local r, g, b
if h < 60 then r, g, b = c, x, 0
elseif h < 120 then r, g, b = x, c, 0
elseif h < 180 then r, g, b = 0, c, x
elseif h < 240 then r, g, b = 0, x, c
elseif h < 300 then r, g, b = x, 0, c
else r, g, b = c, 0, x end
return Color3.fromRGB((r + m) * 255, (g + m) * 255, (b + m) * 255)
end
local function GetTeamColor(player)
if Config.RainbowESP then
return HSVToRGB(RainbowHue, 1, 1)
end
if not player.Team then return Color3.fromRGB(255, 0, 0) end
local localTeam = LocalPlayer.Team
if not localTeam then return Color3.fromRGB(255, 0, 0) end
local isSameTeam = false
if player.Team == localTeam then
isSameTeam = true
elseif localTeam.Name and player.Team.Name then
local localTeamName = localTeam.Name
local playerTeamName = player.Team.Name
if (localTeamName == "Terrorists" and playerTeamName == "Terrorists") or
(localTeamName == "Counter-Terrorists" and playerTeamName == "Counter-Terrorists") then
isSameTeam = true
end
end
if isSameTeam then
return Color3.fromRGB(0, 100, 255)
else
return Color3.fromRGB(255, 0, 0)
end
end
local function GetHealthColor(healthPercent)
if healthPercent > 0.75 then
return Color3.fromRGB(0, 255, 0)
elseif healthPercent > 0.5 then
return Color3.fromRGB(150, 255, 0)
elseif healthPercent > 0.25 then
return Color3.fromRGB(255, 255, 0)
elseif healthPercent > 0.1 then
return Color3.fromRGB(255, 150, 0)
else
return Color3.fromRGB(255, 0, 0)
end
end
local function CreateESPForPlayer(player)
if player == LocalPlayer and not Config.LocalPlayerESP then return end
if ESPData[player] then return end
local espData = {
Player = player,
BoxLines = {},
HealthBarBg = nil,
HealthBarFg = nil,
NameTag = nil
}
for i = 1, 4 do
local line = Drawing.new("Line")
line.Thickness = 2
line.Transparency = 1
line.Visible = false
espData.BoxLines[i] = line
end
local healthBg = Drawing.new("Line")
healthBg.Thickness = 4
healthBg.Color = Color3.fromRGB(0, 0, 0)
healthBg.Transparency = 1
healthBg.Visible = false
espData.HealthBarBg = healthBg
local healthFg = Drawing.new("Line")
healthFg.Thickness = 2
healthFg.Color = Color3.fromRGB(0, 255, 0)
healthFg.Transparency = 1
healthFg.Visible = false
espData.HealthBarFg = healthFg
local nameTag = Drawing.new("Text")
nameTag.Size = 14
nameTag.Center = true
nameTag.Outline = true
nameTag.Color = Color3.fromRGB(255, 255, 255)
nameTag.Transparency = 1
nameTag.Visible = false
nameTag.Text = player.Name
espData.NameTag = nameTag
ESPData[player] = espData
end
local function RemoveESPForPlayer(player)
local espData = ESPData[player]
if not espData then return end
for _, line in pairs(espData.BoxLines) do
pcall(function() line:Remove() end)
end
if espData.HealthBarBg then pcall(function() espData.HealthBarBg:Remove() end) end
if espData.HealthBarFg then pcall(function() espData.HealthBarFg:Remove() end) end
if espData.NameTag then pcall(function() espData.NameTag:Remove() end) end
ESPData[player] = nil
end
local function GetBoundingBox(character)
local head = character:FindFirstChild("Head")
local hrp = character:FindFirstChild("HumanoidRootPart") or character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
if not head or not hrp then return nil end
local lowestY = math.huge
local highestY = -math.huge
for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") then
local partBottom = part.Position.Y - (part.Size.Y / 2)
local partTop = part.Position.Y + (part.Size.Y / 2)
lowestY = math.min(lowestY, partBottom)
highestY = math.max(highestY, partTop)
end
end
if lowestY == math.huge or highestY == -math.huge then return nil end
local cf = hrp.CFrame
local height = highestY - lowestY
local center = Vector3.new(hrp.Position.X, (highestY + lowestY) / 2, hrp.Position.Z)
local size = Vector3.new(2.5, height, 0)
return center, size, cf
end
local function WorldToScreen2D(position)
local screenPos, onScreen = Camera:WorldToViewportPoint(position)
return Vector2.new(screenPos.X, screenPos.Y), onScreen, screenPos.Z
end
local function UpdateESP()
for player, espData in pairs(ESPData) do
if not player.Parent or not player.Character then
for _, line in pairs(espData.BoxLines) do
line.Visible = false
end
espData.HealthBarBg.Visible = false
espData.HealthBarFg.Visible = false
espData.NameTag.Visible = false
continue
end
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health <= 0 then
for _, line in pairs(espData.BoxLines) do
line.Visible = false
end
espData.HealthBarBg.Visible = false
espData.HealthBarFg.Visible = false
espData.NameTag.Visible = false
continue
end
local center, size, cf = GetBoundingBox(character)
if not center then
for _, line in pairs(espData.BoxLines) do
line.Visible = false
end
espData.HealthBarBg.Visible = false
espData.HealthBarFg.Visible = false
espData.NameTag.Visible = false
continue
end
local corners = {
cf * Vector3.new(-size.X/2, size.Y/2, 0),
cf * Vector3.new(size.X/2, size.Y/2, 0),
cf * Vector3.new(size.X/2, -size.Y/2, 0),
cf * Vector3.new(-size.X/2, -size.Y/2, 0)
}
local screenCorners = {}
local allOnScreen = true
for i, corner in ipairs(corners) do
local screenPos, onScreen, depth = WorldToScreen2D(corner)
screenCorners[i] = screenPos
if not onScreen or depth < 0 then
allOnScreen = false
end
end
if allOnScreen then
local teamColor = GetTeamColor(player)
for i = 1, 4 do
local line = espData.BoxLines[i]
local nextIndex = i % 4 + 1
line.From = screenCorners[i]
line.To = screenCorners[nextIndex]
line.Color = teamColor
line.Visible = true
end
local topLeft = screenCorners[1]
local bottomLeft = screenCorners[4]
local healthBarX = topLeft.X - 8
local healthBarHeight = (bottomLeft.Y - topLeft.Y)
espData.HealthBarBg.From = Vector2.new(healthBarX, topLeft.Y)
espData.HealthBarBg.To = Vector2.new(healthBarX, bottomLeft.Y)
espData.HealthBarBg.Visible = true
local healthPercent = humanoid.Health / humanoid.MaxHealth
local healthBarLength = healthBarHeight * healthPercent
espData.HealthBarFg.From = Vector2.new(healthBarX, bottomLeft.Y)
espData.HealthBarFg.To = Vector2.new(healthBarX, bottomLeft.Y - healthBarLength)
espData.HealthBarFg.Color = GetHealthColor(healthPercent)
espData.HealthBarFg.Visible = true
if Config.RainbowESP then
espData.NameTag.Color = HSVToRGB(RainbowHue, 1, 1)
else
espData.NameTag.Color = Color3.fromRGB(255, 255, 255)
end
espData.NameTag.Position = Vector2.new((topLeft.X + screenCorners[2].X) / 2, topLeft.Y - 16)
espData.NameTag.Visible = true
else
for _, line in pairs(espData.BoxLines) do
line.Visible = false
end
espData.HealthBarBg.Visible = false
espData.HealthBarFg.Visible = false
espData.NameTag.Visible = false
end
end
end
local UIGreen = Color3.fromRGB(0, 255, 0)
local function CreateUI()
local panelBg = Drawing.new("Square")
panelBg.Size = Vector2.new(280, 260)
panelBg.Position = Vector2.new(20, 100)
panelBg.Color = Color3.fromRGB(30, 30, 30)
panelBg.Filled = true
panelBg.Transparency = 0.8
panelBg.Visible = true
UIElements.PanelBg = panelBg
local panelBorder = Drawing.new("Square")
panelBorder.Size = Vector2.new(280, 260)
panelBorder.Position = Vector2.new(20, 100)
panelBorder.Color = Color3.fromRGB(100, 100, 100)
panelBorder.Filled = false
panelBorder.Thickness = 2
panelBorder.Transparency = 1
panelBorder.Visible = true
UIElements.PanelBorder = panelBorder
local title = Drawing.new("Text")
title.Text = "Undetected Menu"
title.Size = 18
title.Position = Vector2.new(160, 108)
title.Center = true
title.Color = UIGreen
title.Transparency = 1
title.Visible = true
UIElements.Title = title
local speedValue = Drawing.new("Text")
speedValue.Text = "Speed: 16"
speedValue.Size = 14
speedValue.Position = Vector2.new(30, 135)
speedValue.Color = UIGreen
speedValue.Transparency = 1
speedValue.Visible = true
UIElements.SpeedValue = speedValue
local sliderBg = Drawing.new("Square")
sliderBg.Size = Vector2.new(230, 6)
sliderBg.Position = Vector2.new(35, 172)
sliderBg.Color = Color3.fromRGB(60, 60, 60)
sliderBg.Filled = true
sliderBg.Transparency = 1
sliderBg.Visible = true
UIElements.SliderBg = sliderBg
local sliderFg = Drawing.new("Square")
sliderFg.Size = Vector2.new(0, 6)
sliderFg.Position = Vector2.new(35, 172)
sliderFg.Color = UIGreen
sliderFg.Filled = true
sliderFg.Transparency = 1
sliderFg.Visible = true
UIElements.SliderFg = sliderFg
local speedToggle = Drawing.new("Text")
speedToggle.Text = "[Q] Speed: OFF"
speedToggle.Size = 14
speedToggle.Position = Vector2.new(30, 185)
speedToggle.Color = UIGreen
speedToggle.Transparency = 1
speedToggle.Visible = true
UIElements.SpeedToggle = speedToggle
local triggerToggle = Drawing.new("Text")
triggerToggle.Text = "[T] TriggerBot: OFF"
triggerToggle.Size = 14
triggerToggle.Position = Vector2.new(30, 202)
triggerToggle.Color = UIGreen
triggerToggle.Transparency = 1
triggerToggle.Visible = true
UIElements.TriggerToggle = triggerToggle
local aimbotLabel = Drawing.new("Text")
aimbotLabel.Text = "[HOLD RMB] Aimbot"
aimbotLabel.Size = 14
aimbotLabel.Position = Vector2.new(30, 219)
aimbotLabel.Color = UIGreen
aimbotLabel.Transparency = 1
aimbotLabel.Visible = true
UIElements.AimbotLabel = aimbotLabel
local teamCheck = Drawing.new("Text")
teamCheck.Text = "[F1] TeamCheck: ON"
teamCheck.Size = 14
teamCheck.Position = Vector2.new(30, 236)
teamCheck.Color = UIGreen
teamCheck.Transparency = 1
teamCheck.Visible = true
UIElements.TeamCheck = teamCheck
local rainbowToggle = Drawing.new("Text")
rainbowToggle.Text = "[F2] Rainbow: OFF"
rainbowToggle.Size = 14
rainbowToggle.Position = Vector2.new(30, 253)
rainbowToggle.Color = UIGreen
rainbowToggle.Transparency = 1
rainbowToggle.Visible = true
UIElements.RainbowToggle = rainbowToggle
local localESP = Drawing.new("Text")
localESP.Text = "[F3] LocalESP: OFF"
localESP.Size = 14
localESP.Position = Vector2.new(30, 270)
localESP.Color = UIGreen
localESP.Transparency = 1
localESP.Visible = true
UIElements.LocalESP = localESP
local controls = Drawing.new("Text")
controls.Text = "[CTRL+U/D] Speed Adjust"
controls.Size = 12
controls.Position = Vector2.new(30, 290)
controls.Color = UIGreen
controls.Transparency = 1
controls.Visible = true
UIElements.Controls = controls
local closeBtn = Drawing.new("Text")
closeBtn.Text = "[F9] Kill Script"
closeBtn.Size = 12
closeBtn.Position = Vector2.new(30, 307)
closeBtn.Color = UIGreen
closeBtn.Transparency = 1
closeBtn.Visible = true
UIElements.CloseBtn = closeBtn
local fpsCounter = Drawing.new("Text")
fpsCounter.Text = "FPS: 60"
fpsCounter.Size = 14
fpsCounter.Position = Vector2.new(30, 327)
fpsCounter.Color = UIGreen
fpsCounter.Transparency = 1
fpsCounter.Visible = true
UIElements.FPSCounter = fpsCounter
end
local function UpdateUI()
if UIElements.SpeedValue then
UIElements.SpeedValue.Text = "Speed: " .. Config.SpeedValue
end
if UIElements.SliderFg then
local percent = (Config.SpeedValue - 16) / (30 - 16)
UIElements.SliderFg.Size = Vector2.new(230 * percent, 6)
end
if UIElements.SpeedToggle then
UIElements.SpeedToggle.Text = "[Q] Speed: " .. (Config.SpeedEnabled and "ON" or "OFF")
end
if UIElements.TriggerToggle then
UIElements.TriggerToggle.Text = "[T] TriggerBot: " .. (Config.TriggerBotEnabled and "ON" or "OFF")
end
if UIElements.TeamCheck then
UIElements.TeamCheck.Text = "[F1] TeamCheck: " .. (Config.TeamCheckEnabled and "ON" or "OFF")
end
if UIElements.RainbowToggle then
UIElements.RainbowToggle.Text = "[F2] Rainbow: " .. (Config.RainbowESP and "ON" or "OFF")
end
if UIElements.LocalESP then
UIElements.LocalESP.Text = "[F3] LocalESP: " .. (Config.LocalPlayerESP and "ON" or "OFF")
end
if UIElements.FPSCounter then
UIElements.FPSCounter.Text = "FPS: " .. math.floor(FPS)
end
end
local function ApplySpeed()
local character = LocalPlayer.Character
if not character then return end
if Config.SpeedEnabled then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = Config.SpeedValue
end
else
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = 16
end
end
end
local function GetClosestEnemy()
local closestPlayer = nil
local shortestDistance = math.huge
for _, player in pairs(Players:GetPlayers()) do
local shouldTarget = false
if Config.TeamCheckEnabled then
if player ~= LocalPlayer then
local isSameTeam = false
if player.Team and LocalPlayer.Team then
if player.Team == LocalPlayer.Team then
isSameTeam = true
elseif player.Team.Name and LocalPlayer.Team.Name then
local localTeamName = LocalPlayer.Team.Name
local playerTeamName = player.Team.Name
if (localTeamName == "Terrorists" and playerTeamName == "Terrorists") or
(localTeamName == "Counter-Terrorists" and playerTeamName == "Counter-Terrorists") then
isSameTeam = true
end
end
end
shouldTarget = not isSameTeam
end
else
shouldTarget = player ~= LocalPlayer
end
if shouldTarget and player.Character then
local head = player.Character:FindFirstChild("Head")
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if head and humanoid and humanoid.Health > 0 then
local screenPos, onScreen = Camera:WorldToViewportPoint(head.Position)
if onScreen then
local mousePos = UserInputService:GetMouseLocation()
local distance = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude
if distance < shortestDistance then
shortestDistance = distance
closestPlayer = player
end
end
end
end
end
return closestPlayer
end
local AimbotTarget = nil
local RMBHeld = false
local function Aimbot()
if not RMBHeld then
AimbotTarget = nil
return
end
if not AimbotTarget or not AimbotTarget.Parent then
AimbotTarget = GetClosestEnemy()
end
if AimbotTarget and AimbotTarget.Character then
local head = AimbotTarget.Character:FindFirstChild("Head")
local humanoid = AimbotTarget.Character:FindFirstChildOfClass("Humanoid")
if head and humanoid and humanoid.Health > 0 then
local headPosition = head.Position
local cameraPosition = Camera.CFrame.Position
Camera.CFrame = CFrame.new(cameraPosition, headPosition)
else
AimbotTarget = nil
end
else
AimbotTarget = nil
end
end
local function TriggerBot()
if not Config.TriggerBotEnabled then return end
local character = LocalPlayer.Character
if not character then return end
local head = character:FindFirstChild("Head")
if not head then return end
local mouse = LocalPlayer:GetMouse()
local target = mouse.Target
if target then
local targetPlayer = Players:GetPlayerFromCharacter(target.Parent)
if targetPlayer and targetPlayer ~= LocalPlayer then
local shouldShoot = false
if Config.TeamCheckEnabled then
local isSameTeam = false
if targetPlayer.Team and LocalPlayer.Team then
if targetPlayer.Team == LocalPlayer.Team then
isSameTeam = true
elseif targetPlayer.Team.Name and LocalPlayer.Team.Name then
local localTeamName = LocalPlayer.Team.Name
local targetTeamName = targetPlayer.Team.Name
if (localTeamName == "Terrorists" and targetTeamName == "Terrorists") or
(localTeamName == "Counter-Terrorists" and targetTeamName == "Counter-Terrorists") then
isSameTeam = true
end
end
end
shouldShoot = not isSameTeam
else
shouldShoot = true
end
if shouldShoot then
local targetChar = targetPlayer.Character
if targetChar then
local targetHead = targetChar:FindFirstChild("Head")
if targetHead then
local direction = (targetHead.Position - head.Position).Unit
local distance = (targetHead.Position - head.Position).Magnitude
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.FilterDescendantsInstances = {character, targetChar}
local rayResult = Workspace:Raycast(head.Position, direction * distance, raycastParams)
if not rayResult then
mouse1click()
end
end
end
end
end
end
end
local function OnCharacterAdded(character)
task.wait(0.5)
for _, player in pairs(Players:GetPlayers()) do
if player.Character == character then
RemoveESPForPlayer(player)
CreateESPForPlayer(player)
break
end
end
end
local ctrlPressed = false
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton2 then
RMBHeld = true
return
end
if input.KeyCode == Enum.KeyCode.LeftControl or input.KeyCode == Enum.KeyCode.RightControl then
ctrlPressed = true
return
end
local keyCode = input.KeyCode
if keyCode == Enum.KeyCode.Q then
Config.SpeedEnabled = not Config.SpeedEnabled
UpdateUI()
ApplySpeed()
end
if keyCode == Enum.KeyCode.T then
Config.TriggerBotEnabled = not Config.TriggerBotEnabled
UpdateUI()
end
if keyCode == Enum.KeyCode.F1 then
Config.TeamCheckEnabled = not Config.TeamCheckEnabled
UpdateUI()
end
if keyCode == Enum.KeyCode.F2 then
Config.RainbowESP = not Config.RainbowESP
UpdateUI()
end
if keyCode == Enum.KeyCode.F3 then
Config.LocalPlayerESP = not Config.LocalPlayerESP
if Config.LocalPlayerESP then
CreateESPForPlayer(LocalPlayer)
else
RemoveESPForPlayer(LocalPlayer)
end
UpdateUI()
end
if keyCode == Enum.KeyCode.D and ctrlPressed then
Config.SpeedValue = math.max(16, Config.SpeedValue - 1)
UpdateUI()
ApplySpeed()
end
if keyCode == Enum.KeyCode.U and ctrlPressed then
Config.SpeedValue = math.min(30, Config.SpeedValue + 1)
UpdateUI()
ApplySpeed()
end
if keyCode == Enum.KeyCode.F9 then
Running = false
for player, _ in pairs(ESPData) do
RemoveESPForPlayer(player)
end
for _, element in pairs(UIElements) do
pcall(function() element:Remove() end)
end
for _, conn in pairs(Connections) do
pcall(function() conn:Disconnect() end)
end
AimbotTarget = nil
RMBHeld = false
local character = LocalPlayer.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = 16
end
end
ESPData = {}
UIElements = {}
Connections = {}
return
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton2 then
RMBHeld = false
AimbotTarget = nil
return
end
if input.KeyCode == Enum.KeyCode.LeftControl or input.KeyCode == Enum.KeyCode.RightControl then
ctrlPressed = false
end
end)
for _, player in ipairs(Players:GetPlayers()) do
CreateESPForPlayer(player)
if player.Character then
Connections[#Connections + 1] = player.Character.ChildAdded:Connect(OnCharacterAdded)
end
Connections[#Connections + 1] = player.CharacterAdded:Connect(OnCharacterAdded)
end
Connections[#Connections + 1] = Players.PlayerAdded:Connect(function(player)
CreateESPForPlayer(player)
Connections[#Connections + 1] = player.CharacterAdded:Connect(OnCharacterAdded)
end)
Connections[#Connections + 1] = Players.PlayerRemoving:Connect(RemoveESPForPlayer)
CreateUI()
UpdateUI()
Connections[#Connections + 1] = RunService.RenderStepped:Connect(function()
if not Running then
return
end
local currentTime = tick()
local deltaTime = currentTime - LastFrameTime
LastFrameTime = currentTime
FPS = 1 / deltaTime
RainbowHue = (RainbowHue + 2) % 360
Camera = Workspace.CurrentCamera
ApplySpeed()
TriggerBot()
Aimbot()
Camera = Workspace.CurrentCamera
UpdateESP()
UpdateUI()
end)No comments yet for this script.



