BigPackets Forum

Products & Supported Games => Garrys Mod => Topic started by: asdqwe1548 on August 19, 2018, 04:19:33 am

Title: [OLD CODING] Gmod CPU Intensive 3D Box Src
Post by: asdqwe1548 on August 19, 2018, 04:19:33 am
local emt = FindMetaTable("Entity");
local vmt = FindMetaTable("Vector");
 
 
local function ESP()
    for k, v in next, player.GetAll() do
        if (v == LocalPlayer() || !IsValid(v) || emt.Health(v) <= 0 || emt.IsDormant(v)) then
            continue;
        end
        local pos = emt.GetPos(v);
        local min, max = emt.GetCollisionBounds(v);
        min = min + pos;
        max = max + pos;
        local corners = {
            Vector(min.x, min.y, min.z);
            Vector(max.x, min.y, min.z);
            Vector(max.x, max.y, min.z);
            Vector(min.x, max.y, min.z);
            Vector(min.x, min.y, max.z);
            Vector(max.x, min.y, max.z);
            Vector(max.x, max.y, max.z);
            Vector(min.x, max.y, max.z);
        };
 
        for _k, _v in next, corners do
            corners[_k] = vmt.ToScreen(_v);
        end
       
        surface.SetDrawColor(255, 255, 255);
        for i = 1, 12 do
            local meme = math.Round((1/83160 * i^11) + (-67/75600 * i^10) + (187/6480 * i^9) + (-5507/10080 * i^8) + (7189/1080 * i^7) + (-49099/900 * i^6) + (1537957/5040 * i^5) + (-34977989/30240 * i^4) + (9350659/3240 * i^3) + (-18749719/4200 * i^2) + (3761167/990 * i) -1320);
            local _meme = math.Round((-23/4989600 * i^11) + (29/75600 * i^10) + (-253/18144 * i^9) + (5881/20160 * i^8) + (-196141/50400 * i^7) + (249329/7200 * i^6) + (-18928891/90720 * i^5) + (51140147/60480 * i^4) + (-507709669/226800 * i^3) + (91828993/25200 * i^2) + (-22393351/6930 * i) + 1160);
            surface.DrawLine(corners[meme].x, corners[meme].y, corners[_meme].x, corners[_meme].y);
        end
    end
end
 
oHUDPaint = oHUDPaint || GAMEMODE.HUDPaint;
 
function GAMEMODE:HUDPaint()
    ESP();
end
Hey guys here is my 3d box code that uses method difference so that drawline only has to be called once in a single for loop.

Literally no idea why i did this but its pretty cool.