OutdatedBetter Dynamic 2D/3D Box ESP

Posts 1–4 of 4 · Page 1 of 1
Better Dynamic 2D/3D Box ESP
Noticed people are pasting from this horrid old dynamic box esp so I decided to make one from scratch, it's much better.

Feel free to use, make sure you credit me though (most of you won't anyways).

Source:
http://pastebin.com/epRrppVR

Code:
--[[
    Dynamic 2D/3D box esp
        by Kujou
]]--

local function Draw3DBox(pos,min,max)
    -- Thanks dad
    local b = {}
    -- Bottom Square
    b[1] = {Vector(min.x,min.y,min.z),Vector(max.x,min.y,min.z)}
    b[2] = {Vector(min.x,min.y,min.z),Vector(min.x,max.y,min.z)}
    b[3] = {Vector(min.x,max.y,min.z),Vector(max.x,max.y,min.z)}
    b[4] = {Vector(max.x,max.y,min.z),Vector(max.x,min.y,min.z)}
    -- Pillars
    b[5] = {Vector(min.x,min.y,min.z),Vector(min.x,min.y,max.z)}
    b[6] = {Vector(min.x,max.y,min.z),Vector(min.x,max.y,max.z)}
    b[7] = {Vector(max.x,max.y,min.z),Vector(max.x,max.y,max.z)}
    b[8] = {Vector(max.x,min.y,min.z),Vector(max.x,min.y,max.z)}
    -- Top Square
    b[9] = {Vector(min.x,min.y,max.z),Vector(max.x,min.y,max.z)}
    b[10] = {Vector(min.x,min.y,max.z),Vector(min.x,max.y,max.z)}
    b[11] = {Vector(min.x,max.y,max.z),Vector(max.x,max.y,max.z)}
    b[12] = {Vector(max.x,max.y,max.z),Vector(max.x,min.y,max.z)}
    -- Iterate corners and draw line to join them
    for k,v in next,b do
        local p = pos:ToScreen()
        local s = (pos + v[1]):ToScreen()
        local e = (pos + v[2]):ToScreen()
        surface.DrawLine(s.x,s.y,e.x,e.y)
    end
end

local function Draw2DBox(pos,min,max)
    local h = (pos + Vector(0,0,max.z)):ToScreen().y
    min = min + pos
    max = max + pos
    pos = pos:ToScreen()
    -- just the sides of the box are needed
    local s = {}
    s[1] = Vector(min.x,min.y,0):ToScreen().x
    s[2] = Vector(min.x,max.y,0):ToScreen().x
    s[3] = Vector(max.x,max.y,0):ToScreen().x
    s[4] = Vector(max.x,min.y,0):ToScreen().x
    -- lowest = left side of the box, highest = right side of the box 
    local lowest = math.min(unpack(s))
    local highest = math.max(unpack(s))
    -- Drawing the box itself
    surface.DrawOutlinedRect(lowest,h,highest-lowest,pos.y-h)
end

local function DrawESP()
    for k,v in next, player.GetAll() do
            if (v == LocalPlayer() || v:IsDormant() || !ply:Alive()) then
                continue
            end
            local pos,min,max = ply:GetPos(),ply:OBBMins(),ply:OBBMaxs()
            surface.SetDrawColor(255,0,0)
            Draw3DBox(pos,min,max)
            surface.SetDrawColor(0,255,0)
            Draw2DBox(pos,min,max)
    end
end
hook.Add("HUDPaint","esp",DrawESP)
you have to change a couple things to make this work. will probably confuse 90% of the retarded people here.
Since this is an ESP thread an everything, here's my totally not dynamic but still pcool ESP codes
Code:
function X.CornerBox(x, y, w, h, color)
    surface.SetDrawColor(color)

    // Box: Upper Left Corner
    surface.DrawLine(x, y, x, y + (h / 5))
    surface.DrawLine(x, y, x + (w / 5), y)

    // Box: Upper Right
    surface.DrawLine(x + w, y, x + w - (w / 5), y)
    surface.DrawLine(x + w, y, x + w, y + (h / 5))

    // Box: Bottom Left Corner
    surface.DrawLine(x, y + h, x + (w / 5), y + h)
    surface.DrawLine(x, y + h, x, y + h - (h / 5))

    // Box: Bottom Right Corner
    surface.DrawLine(x + w, y + h, x + w - (w / 5), y + h)
    surface.DrawLine(x + w, y + h, x + w, y + h - (h / 5))
end

function X.DrawCornerBoxOutlined(x, y, w, h, color)
    X.CornerBox(x - 1, y - 1, w + 2, h + 2, color)
    X.CornerBox(x, y, w, h, Color(196, 196, 196, 255))
end
i.imgur .com/jTxoPE7.jpg
Quote Originally Posted by 0 - p100 real quick View Post
Since this is an ESP thread an everything, here's my totally not dynamic but still pcool ESP codes
Code:
function X.CornerBox(x, y, w, h, color)
    surface.SetDrawColor(color)

    // Box: Upper Left Corner
    surface.DrawLine(x, y, x, y + (h / 5))
    surface.DrawLine(x, y, x + (w / 5), y)

    // Box: Upper Right
    surface.DrawLine(x + w, y, x + w - (w / 5), y)
    surface.DrawLine(x + w, y, x + w, y + (h / 5))

    // Box: Bottom Left Corner
    surface.DrawLine(x, y + h, x + (w / 5), y + h)
    surface.DrawLine(x, y + h, x, y + h - (h / 5))

    // Box: Bottom Right Corner
    surface.DrawLine(x + w, y + h, x + w - (w / 5), y + h)
    surface.DrawLine(x + w, y + h, x + w, y + h - (h / 5))
end

function X.DrawCornerBoxOutlined(x, y, w, h, color)
    X.CornerBox(x - 1, y - 1, w + 2, h + 2, color)
    X.CornerBox(x, y, w, h, Color(196, 196, 196, 255))
end
i.imgur .com/jTxoPE7.jpg
That's public UC espbox, exact code lol
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us