Draw Esp
Key RequiredUniversal

Draw Esp

Universal ScriptEploitEploit 653 views 190 executesUpdated Mar 29, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•272 lines (11185 chars)
-- Right Shift to toggle the menu

if getgenv().DrawESP_Executed then return end
getgenv().DrawESP_Executed = true

local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera

local ConfigFile = "draw_esp_config.json"

local Settings = {
    Enabled = true,
    Box = true,
    Name = true,
    Health = true,
    Skele = true,
    Look = true,
    BoxColor = {1, 1, 1},
    NameColor = {1, 1, 1},
    SkeleColor = {1, 1, 1},
    LookColor = {1, 0, 0},
    MenuPos = {X = 100, Y = 100},
    Visible = true,
    MenuKey = Enum.KeyCode.RightShift
}

local ColorMap = {
    Red = {1, 0, 0},
    Green = {0, 1, 0},
    Blue = {0, 0, 1},
    Black = {0, 0, 0},
    White = {1, 1, 1}
}

local function Save() 
    pcall(function() writefile(ConfigFile, HttpService:JSONEncode(Settings)) end) 
end

pcall(function()
    if isfile(ConfigFile) then
        local data = HttpService:JSONDecode(readfile(ConfigFile))
        for k, v in pairs(data) do Settings[k] = v end
    end
end)

local UI_Registry = {}
local function Create(type, props)
    local obj = Drawing.new(type)
    for i, v in pairs(props) do obj[i] = v end
    table.insert(UI_Registry, obj)
    return obj
end

local MainBG = Create("Square", {Thickness = 1, Filled = true, Color = Color3.fromRGB(15, 15, 15), Transparency = 1, Size = Vector2.new(240, 310)})
local Header = Create("Square", {Thickness = 0, Filled = true, Color = Color3.fromRGB(30, 30, 30), Transparency = 1, Size = Vector2.new(240, 30)})
local Title = Create("Text", {Size = 16, Center = true, Outline = true, Color = Color3.fromRGB(255, 255, 255), Text = "DRAW ESP"})

local KillBtn = Create("Text", {Size = 14, Center = true, Outline = true, Color = Color3.fromRGB(255, 100, 100), Text = "[ KILL SCRIPT ]"})
local EraseBtn = Create("Text", {Size = 14, Center = true, Outline = true, Color = Color3.fromRGB(255, 150, 0), Text = "[ STOP AUTO-LOAD ]"})

local Rows = {}
local Items = {
    {"Master Switch", "Enabled"},
    {"Boxes", "Box", "BoxColor"},
    {"Names", "Name", "NameColor"},
    {"Health Bars", "Health"},
    {"Skeletons", "Skele", "SkeleColor"},
    {"Look Vector", "Look", "LookColor"}
}

for i, item in ipairs(Items) do
    local row = {
        Label = Create("Text", {Size = 14, Outline = true, Color = Color3.new(0.8, 0.8, 0.8), Text = item[1]}),
        Status = Create("Text", {Size = 14, Outline = true}),
        Colors = {},
        Key = item[2],
        CKey = item[3]
    }
    if item[3] then
        for name, _ in pairs(ColorMap) do
            row.Colors[name] = Create("Square", {Size = Vector2.new(10, 10), Filled = true, Thickness = 1})
        end
    end
    Rows[i] = row
end

local function UpdateMenu()
    local Base = Vector2.new(Settings.MenuPos.X, Settings.MenuPos.Y)
    MainBG.Position = Base
    MainBG.Visible = Settings.Visible
    Header.Position = Base
    Header.Visible = Settings.Visible
    Title.Position = Base + Vector2.new(120, 7)
    Title.Visible = Settings.Visible
    
    KillBtn.Position = Base + Vector2.new(120, 255)
    KillBtn.Visible = Settings.Visible
    EraseBtn.Position = Base + Vector2.new(120, 280)
    EraseBtn.Visible = Settings.Visible

    for i, row in ipairs(Rows) do
        local YOff = 35 + (i * 28)
        row.Label.Visible = Settings.Visible
        row.Label.Position = Base + Vector2.new(10, YOff)
        
        row.Status.Visible = Settings.Visible
        row.Status.Position = Base + Vector2.new(100, YOff)
        row.Status.Text = Settings[row.Key] and "ON" or "OFF"
        row.Status.Color = Settings[row.Key] and Color3.new(0, 1, 0) or Color3.new(1, 0, 0)
        
        local dotX = 145
        for name, dot in pairs(row.Colors) do
            dot.Visible = Settings.Visible
            dot.Position = Base + Vector2.new(dotX, YOff + 2)
            dot.Color = Color3.new(unpack(ColorMap[name]))
            dotX = dotX + 16
        end
    end
end

local ESP_Map = {}
local function CreateESP(p)
    local d = {
        Box = Drawing.new("Square"),
        Name = Drawing.new("Text"),
        HBack = Drawing.new("Square"),
        HMain = Drawing.new("Square"),
        Look = Drawing.new("Line"),
        Skele = {}
    }
    d.Box.Thickness = 1
    d.Name.Size = 13 d.Name.Center = true d.Name.Outline = true
    d.HBack.Filled = true d.HBack.Transparency = 0.5
    d.HMain.Filled = true
    for i=1, 15 do table.insert(d.Skele, Drawing.new("Line")) end
    ESP_Map[p] = d
end

local function RemoveESP(p)
    if ESP_Map[p] then
        for _, v in pairs(ESP_Map[p]) do
            if type(v) == "table" then for _, l in pairs(v) do l:Remove() end else v:Remove() end
        end
        ESP_Map[p] = nil
    end
end

local R15 = {{"Head","UpperTorso"},{"UpperTorso","LowerTorso"},{"UpperTorso","LeftUpperArm"},{"LeftUpperArm","LeftLowerArm"},{"UpperTorso","RightUpperArm"},{"RightUpperArm","RightLowerArm"},{"LowerTorso","LeftUpperLeg"},{"LeftUpperLeg","LeftLowerLeg"},{"LowerTorso","RightUpperLeg"},{"RightUpperLeg","RightLowerLeg"}}
local R6 = {{"Head","Torso"},{"Torso","Left Arm"},{"Torso","Right Arm"},{"Torso","Left Leg"},{"Torso","Right Leg"}}

local Dragging, DragStart = false, Vector2.new()
local RenderConn

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Settings.MenuKey then Settings.Visible = not Settings.Visible end
    if Settings.Visible and input.UserInputType == Enum.UserInputType.MouseButton1 then
        local Mouse = UIS:GetMouseLocation()
        local Base = Vector2.new(Settings.MenuPos.X, Settings.MenuPos.Y)
        
        if Mouse.X > Base.X and Mouse.X < Base.X + 240 and Mouse.Y > Base.Y and Mouse.Y < Base.Y + 35 then
            Dragging = true DragStart = Base - Mouse
        end
        
        if Mouse.X > Base.X + 40 and Mouse.X < Base.X + 200 and Mouse.Y > Base.Y + 250 and Mouse.Y < Base.Y + 275 then
            if RenderConn then RenderConn:Disconnect() end
            for p, _ in pairs(ESP_Map) do RemoveESP(p) end
            for _, obj in pairs(UI_Registry) do obj:Remove() end
            getgenv().DrawESP_Executed = false
        end

        if Mouse.X > Base.X + 40 and Mouse.X < Base.X + 200 and Mouse.Y > Base.Y + 275 and Mouse.Y < Base.Y + 300 then
            pcall(function() delfile(ConfigFile) end)
        end

        for i, row in ipairs(Rows) do
            local Y = Base.Y + 35 + (i * 28)
            if Mouse.Y > Y and Mouse.Y < Y + 22 then
                if Mouse.X > Base.X + 95 and Mouse.X < Base.X + 140 then
                    Settings[row.Key] = not Settings[row.Key]
                    Save()
                end
                local dotX = 145
                for name, _ in pairs(row.Colors) do
                    if Mouse.X > Base.X + dotX and Mouse.X < Base.X + dotX + 12 then
                        Settings[row.CKey] = ColorMap[name]
                        Save()
                    end
                    dotX = dotX + 16
                end
            end
        end
    end
end)

UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then Dragging = false end end)

RenderConn = RunService.RenderStepped:Connect(function()
    if Dragging then
        local Mouse = UIS:GetMouseLocation()
        Settings.MenuPos = {X = Mouse.X + DragStart.X, Y = Mouse.Y + DragStart.Y}
    end
    UpdateMenu()

    for p, d in pairs(ESP_Map) do
        local char = p.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        local root = char and char:FindFirstChild("HumanoidRootPart")
        if Settings.Enabled and char and hum and root and hum.Health > 0 then
            local pos, on = Camera:WorldToViewportPoint(root.Position)
            if on then
                local head = char:FindFirstChild("Head")
                local hTop = Camera:WorldToViewportPoint(head.Position + Vector3.new(0, 0.7, 0))
                local lBot = Camera:WorldToViewportPoint(root.Position - Vector3.new(0, 3, 0))
                local h, w = math.abs(hTop.Y - lBot.Y), math.abs(hTop.Y - lBot.Y) / 1.6
                
                d.Box.Visible = Settings.Box
                d.Box.Size = Vector2.new(w, h)
                d.Box.Position = Vector2.new(pos.X - w/2, pos.Y - h/2)
                d.Box.Color = Color3.new(unpack(Settings.BoxColor))
                
                d.Name.Visible = Settings.Name
                d.Name.Text = p.Name
                d.Name.Position = Vector2.new(pos.X, pos.Y - h/2 - 16)
                d.Name.Color = Color3.new(unpack(Settings.NameColor))
                
                if Settings.Health then
                    local hp = hum.Health / hum.MaxHealth
                    d.HBack.Visible, d.HMain.Visible = true, true
                    d.HBack.Size = Vector2.new(4, h)
                    d.HBack.Position = Vector2.new(pos.X - w/2 - 6, pos.Y - h/2)
                    d.HMain.Size = Vector2.new(2, h * hp)
                    d.HMain.Position = Vector2.new(pos.X - w/2 - 5, (pos.Y + h/2) - (h * hp))
                    d.HMain.Color = Color3.fromHSV(hp * 0.3, 1, 1)
                else d.HBack.Visible, d.HMain.Visible = false, false end

                if Settings.Look then
                    local s, o1 = Camera:WorldToViewportPoint(head.Position)
                    local e, o2 = Camera:WorldToViewportPoint(head.Position + head.CFrame.LookVector * 10)
                    d.Look.Visible = o1 and o2
                    d.Look.From, d.Look.To = Vector2.new(s.X, s.Y), Vector2.new(e.X, e.Y)
                    d.Look.Color = Color3.new(unpack(Settings.LookColor))
                else d.Look.Visible = false end

                if Settings.Skele then
                    local bones = hum.RigType == Enum.HumanoidRigType.R15 and R15 or R6
                    for i, b in ipairs(bones) do
                        local p1, p2 = char:FindFirstChild(b[1]), char:FindFirstChild(b[2])
                        if p1 and p2 then
                            local v1, on1 = Camera:WorldToViewportPoint(p1.Position)
                            local v2, on2 = Camera:WorldToViewportPoint(p2.Position)
                            d.Skele[i].Visible = on1 and on2
                            d.Skele[i].From, d.Skele[i].To = Vector2.new(v1.X, v1.Y), Vector2.new(v2.X, v2.Y)
                            d.Skele[i].Color = Color3.new(unpack(Settings.SkeleColor))
                        end
                    end
                else for _, l in pairs(d.Skele) do l.Visible = false end end
            else
                for _, obj in pairs(d) do if type(obj)=="table" then for _, l in pairs(obj) do l.Visible=false end else obj.Visible=false end end
            end
        else
            for _, obj in pairs(d) do if type(obj)=="table" then for _, l in pairs(obj) do l.Visible=false end else obj.Visible=false end end
        end
    end
end)

for _, p in pairs(Players:GetPlayers()) do if p ~= LocalPlayer then CreateESP(p) end end
Players.PlayerAdded:Connect(CreateESP)
Players.PlayerRemoving:Connect(RemoveESP)

Features & Information

Just toggle,boxes,names,health bar,skeletons and look vector. Also requires a Drawing library like https://potassium.gitbook.io/api/environment/drawing .
#Draw#Esp#Undetected#Ai made

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts