--[[
Universal ScreenGui ESP – Skeleton + Box + Info
Uses ONLY ScreenGui and Frames. Works on ALL executors.
Customize the CONFIG table.
]]
print("hello1")
-- // CONFIG
local CONFIG = {
Enabled = true,
TeamCheck = false,
Boxes = true,
Skeleton = true,
Names = true,
Distance = true,
HealthBar = true,
BoxThickness = 2,
SkeletonThickness = 1, -- line thickness in pixels (using frames)
NameSize = 14,
DistanceSize = 13,
HealthBarWidth = 2,
HealthBarHeight = 4,
BoxColor = Color3.fromRGB(255, 255, 255),
BoxVisibleColor = Color3.fromRGB(255, 255, 255),
BoxInvisibleColor = Color3.fromRGB(200, 200, 200),
SkeletonColor = Color3.fromRGB(0, 255, 128),
NameColor = Color3.fromRGB(255, 255, 255),
DistanceColor = Color3.fromRGB(200, 200, 200),
HealthHigh = Color3.fromRGB(0, 255, 0),
HealthLow = Color3.fromRGB(255, 0, 0),
HealthBg = Color3.fromRGB(20, 20, 20),
MaxDistance = nil,
}
-- // SERVICES
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
-- // SCREEN GUI
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "UniversalESP"
ScreenGui.ResetOnSpawn = false
ScreenGui.IgnoreGuiInset = true
ScreenGui.Parent = (LocalPlayer:FindFirstChildOfClass("PlayerGui") or game:GetService("CoreGui"))
-- If CoreGui is locked, fallback to PlayerGui
if not pcall(function() ScreenGui.Parent = game:GetService("CoreGui") end) then
ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
end
-- // UTILITY: create a line using a rotated frame
local function createLine(parent)
local frame = Instance.new("Frame")
frame.BorderSizePixel = 0
frame.BackgroundColor3 = CONFIG.SkeletonColor
frame.Visible = false
frame.Parent = parent
return frame
end
-- // UTILITY: set line from two 2D points
local function setLine(line, from, to, thickness)
local distance = (to - from).Magnitude
if distance < 1 then
line.Visible = false
return
end
local center = (from + to) / 2
local angle = math.deg(math.atan2(to.Y - from.Y, to.X - from.X))
line.Size = UDim2.new(0, distance, 0, thickness or CONFIG.SkeletonThickness)
line.Position = UDim2.new(0, center.X - distance/2, 0, center.Y - (thickness or CONFIG.SkeletonThickness)/2)
line.Rotation = angle
line.Visible = true
end
-- // UTILITY: create a text label
local function createTextLabel(parent)
local label = Instance.new("TextLabel")
label.BackgroundTransparency = 1
label.TextColor3 = CONFIG.NameColor
label.Font = Enum.Font.SourceSans
label.TextSize = CONFIG.NameSize
label.TextStrokeTransparency = 0.5
label.Visible = false
label.Parent = parent
return label
end
-- // PLAYER ESP STORAGE
local playerFolders = {} -- [player] = folder in ScreenGui
local function setupPlayer(player)
local folder = Instance.new("Frame") -- Changed from Folder to Frame
folder.Name = player.Name
folder.BackgroundTransparency = 1 -- Invisible container
folder.Size = UDim2.new(0, 0, 0, 0) -- Zero size, won't interfere
folder.Parent = ScreenGui
local boxFrame = Instance.new("Frame")
boxFrame.BorderSizePixel = 0
boxFrame.BackgroundTransparency = 1
boxFrame.Visible = false
boxFrame.Parent = folder
local boxOutline = {}
-- 4 border frames (top, bottom, left, right) to make box outline
for _ = 1, 4 do
local border = Instance.new("Frame")
border.BorderSizePixel = 0
border.BackgroundColor3 = CONFIG.BoxColor
border.Visible = false
border.Parent = folder
table.insert(boxOutline, border)
end
local skeletonLines = {}
for _ = 1, 15 do
local line = createLine(folder)
table.insert(skeletonLines, line)
end
local nameLabel = createTextLabel(folder)
local distanceLabel = createTextLabel(folder)
local hpBg = Instance.new("Frame")
hpBg.BorderSizePixel = 0
hpBg.BackgroundColor3 = CONFIG.HealthBg
hpBg.Visible = false
hpBg.Parent = folder
local hpFill = Instance.new("Frame")
hpFill.BorderSizePixel = 0
hpFill.BackgroundColor3 = CONFIG.HealthHigh
hpFill.Visible = false
hpFill.Parent = folder
playerFolders[player] = {
folder = folder,
boxOutline = boxOutline,
skeletonLines = skeletonLines,
nameLabel = nameLabel,
distanceLabel = distanceLabel,
hpBg = hpBg,
hpFill = hpFill,
}
end
local function removePlayer(player)
local data = playerFolders[player]
if data then
data.folder:Destroy()
playerFolders[player] = nil
end
end
for _, player in ipairs(Players:GetPlayers()) do
if player ~= LocalPlayer then setupPlayer(player) end
end
Players.PlayerAdded:Connect(function(player)
if player ~= LocalPlayer then setupPlayer(player) end
end)
Players.PlayerRemoving:Connect(removePlayer)
-- // WORLD TO SCREEN
local function w2s(pos)
local vec, on = Camera:WorldToViewportPoint(pos)
return Vector2.new(vec.X, vec.Y), on
end
-- // BOUNDING BOX
local function getBBox(character)
local minX, minY, maxX, maxY = math.huge, math.huge, -math.huge, -math.huge
local any = false
for _, part in ipairs(character:GetChildren()) do
if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
local pos, on = w2s(part.Position)
if on then
any = true
if pos.X < minX then minX = pos.X end
if pos.Y < minY then minY = pos.Y end
if pos.X > maxX then maxX = pos.X end
if pos.Y > maxY then maxY = pos.Y end
end
end
end
if not any then return nil end
minX = math.clamp(minX, 0, Camera.ViewportSize.X)
maxX = math.clamp(maxX, 0, Camera.ViewportSize.X)
minY = math.clamp(minY, 0, Camera.ViewportSize.Y)
maxY = math.clamp(maxY, 0, Camera.ViewportSize.Y)
return Vector2.new(minX, minY), Vector2.new(maxX - minX, maxY - minY)
end
-- // RENDER LOOP
RunService.RenderStepped:Connect(function()
if not CONFIG.Enabled then
for _, data in pairs(playerFolders) do
data.folder.Visible = false
end
return
end
local localTeam = nil
if CONFIG.TeamCheck and LocalPlayer.Team then
localTeam = LocalPlayer.Team.TeamColor.Color
end
for _, player in ipairs(Players:GetPlayers()) do
if player == LocalPlayer then continue end
local data = playerFolders[player]
if not data then continue end
local char = player.Character
local valid = char and char:FindFirstChild("Humanoid") and char.Humanoid.Health > 0
if not valid then
data.folder.Visible = false
continue
end
if CONFIG.TeamCheck and localTeam and player.Team and player.Team.TeamColor.Color == localTeam then
data.folder.Visible = false
continue
end
local root = char:FindFirstChild("HumanoidRootPart")
if not root then
data.folder.Visible = false
continue
end
if CONFIG.MaxDistance and (Camera.CFrame.Position - root.Position).Magnitude > CONFIG.MaxDistance then
data.folder.Visible = false
continue
end
local head = char:FindFirstChild("Head")
local headPos = head and head.Position or root.Position + Vector3.new(0,2,0)
local headScreen, headOnScreen = w2s(headPos)
data.folder.Visible = true
-- BOX
if CONFIG.Boxes then
local topLeft, size = getBBox(char)
if topLeft and size then
local tl = topLeft
local w, h = size.X, size.Y
-- Top border
local tBorder = data.boxOutline[1]
tBorder.Size = UDim2.new(0, w, 0, CONFIG.BoxThickness)
tBorder.Position = UDim2.new(0, tl.X, 0, tl.Y)
tBorder.BackgroundColor3 = (headOnScreen and CONFIG.BoxVisibleColor or CONFIG.BoxInvisibleColor)
tBorder.Visible = true
-- Bottom border
local bBorder = data.boxOutline[2]
bBorder.Size = UDim2.new(0, w, 0, CONFIG.BoxThickness)
bBorder.Position = UDim2.new(0, tl.X, 0, tl.Y + h - CONFIG.BoxThickness)
bBorder.BackgroundColor3 = (headOnScreen and CONFIG.BoxVisibleColor or CONFIG.BoxInvisibleColor)
bBorder.Visible = true
-- Left border
local lBorder = data.boxOutline[3]
lBorder.Size = UDim2.new(0, CONFIG.BoxThickness, 0, h)
lBorder.Position = UDim2.new(0, tl.X, 0, tl.Y)
lBorder.BackgroundColor3 = (headOnScreen and CONFIG.BoxVisibleColor or CONFIG.BoxInvisibleColor)
lBorder.Visible = true
-- Right border
local rBorder = data.boxOutline[4]
rBorder.Size = UDim2.new(0, CONFIG.BoxThickness, 0, h)
rBorder.Position = UDim2.new(0, tl.X + w - CONFIG.BoxThickness, 0, tl.Y)
rBorder.BackgroundColor3 = (headOnScreen and CONFIG.BoxVisibleColor or CONFIG.BoxInvisibleColor)
rBorder.Visible = true
else
for _, b in ipairs(data.boxOutline) do b.Visible = false end
end
else
for _, b in ipairs(data.boxOutline) do b.Visible = false end
end
-- SKELETON
if CONFIG.Skeleton then
local boneParts = {
"Head", "UpperTorso", "LowerTorso",
"LeftUpperArm", "LeftLowerArm", "LeftHand",
"RightUpperArm", "RightLowerArm", "RightHand",
"LeftUpperLeg", "LeftLowerLeg", "LeftFoot",
"RightUpperLeg", "RightLowerLeg", "RightFoot",
}
local bones = {}
for _, name in ipairs(boneParts) do
local part = char:FindFirstChild(name)
if part and part:IsA("BasePart") then
local screen, on = w2s(part.Position)
if on then bones[name] = screen end
end
end
local connections = {
{"Head", "UpperTorso"},
{"UpperTorso", "LowerTorso"},
{"UpperTorso", "LeftUpperArm"},
{"LeftUpperArm", "LeftLowerArm"},
{"LeftLowerArm", "LeftHand"},
{"UpperTorso", "RightUpperArm"},
{"RightUpperArm", "RightLowerArm"},
{"RightLowerArm", "RightHand"},
{"LowerTorso", "LeftUpperLeg"},
{"LeftUpperLeg", "LeftLowerLeg"},
{"LeftLowerLeg", "LeftFoot"},
{"LowerTorso", "RightUpperLeg"},
{"RightUpperLeg", "RightLowerLeg"},
{"RightLowerLeg", "RightFoot"},
{"LeftUpperArm", "RightUpperArm"},
}
for i, conn in ipairs(connections) do
local line = data.skeletonLines[i]
local from = bones[conn[1]]
local to = bones[conn[2]]
if from and to then
setLine(line, from, to, CONFIG.SkeletonThickness)
line.BackgroundColor3 = CONFIG.SkeletonColor
else
line.Visible = false
end
end
else
for _, line in ipairs(data.skeletonLines) do line.Visible = false end
end
-- NAME & DISTANCE
local nameText = CONFIG.Names and player.Name or ""
local distText = ""
if CONFIG.Distance then
local dist = math.floor((Camera.CFrame.Position - root.Position).Magnitude)
distText = "[" .. dist .. "m]"
end
local combined = nameText .. (nameText ~= "" and distText ~= "" and " " or "") .. distText
data.nameLabel.Visible = headOnScreen and combined ~= ""
if data.nameLabel.Visible then
data.nameLabel.Text = combined
data.nameLabel.Position = UDim2.new(0, headScreen.X - data.nameLabel.TextBounds.X/2, 0, headScreen.Y - 25)
data.nameLabel.TextColor3 = CONFIG.NameColor
end
-- HEALTH BAR
if CONFIG.HealthBar and headOnScreen then
local hum = char:FindFirstChild("Humanoid")
if hum and hum.MaxHealth > 0 then
local pct = hum.Health / hum.MaxHealth
local barX = headScreen.X - 20
local barY = headScreen.Y + 10
local len = 40
data.hpBg.Size = UDim2.new(0, len, 0, CONFIG.HealthBarHeight)
data.hpBg.Position = UDim2.new(0, barX, 0, barY)
data.hpBg.Visible = true
data.hpFill.Size = UDim2.new(0, len * pct, 0, CONFIG.HealthBarHeight)
data.hpFill.Position = UDim2.new(0, barX, 0, barY)
data.hpFill.BackgroundColor3 = pct > 0.5 and CONFIG.HealthHigh or
pct > 0.25 and Color3.fromRGB(255, 165, 0) or
CONFIG.HealthLow
data.hpFill.Visible = true
else
data.hpBg.Visible = false
data.hpFill.Visible = false
end
else
data.hpBg.Visible = false
data.hpFill.Visible = false
end
end
end)