Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- NiCeeee
- local S = {
- [ "Detours" ] = {
- [ "OldFunctions" ] = {}
- },
- [ "Hooks" ] = {},
- [ "FontMenu" ] = {
- [ "font" ] = "DermaDefault",
- [ "size" ] = 50,
- [ "weight" ] = 500,
- [ "blursize" ] = 0,
- [ "scanlines" ] = 0,
- [ "antialias" ] = true,
- [ "shadow" ] = false
- },
- [ "FontESP" ] = {
- [ "font" ] = "ChatFont",
- [ "size" ] = 16,
- [ "weight" ] = 500,
- [ "blursize" ] = 0,
- [ "scanlines" ] = 0,
- [ "antialias" ] = false,
- [ "shadow" ] = true
- },
- [ "Delays" ] = {}
- }
- -- Delay Enumerations --
- local DELAY_NONE = 1
- local DELAY_DETOUR = 2
- -- Init --
- function S.DoDelayed( typ, name, func )
- S.Delays[ name ] = { typ, name, func }
- end
- function S.Init()
- for k, tab in pairs( S.Delays ) do
- local typ = tab[ 1 ]
- local name = tab[ 2 ]
- local func = tab[ 3 ]
- if ( typ == DELAY_DETOUR ) then
- S.DoDetourStuff( name, func )
- continue
- end
- func()
- end
- end
- function S.ShutDown()
- local prefix = ""
- for k, v in pairs( S.Detours.OldFunctions ) do
- local tab = string.Explode( ".", k )
- _G[ tab[ 1 ] ][ tab[ 2 ] ] = v -- you will need to update this if the function you are overriding is more than one table deep (not including _G)
- prefix = S.DoDetourStuff( k, nil, "Removed" ) -- Le cause i wanted tew :#3)>
- end
- MsgC( Color( 75, 120, 255 ), prefix .. ' - ', Color( 75, 136, 255 ), 'Cheat unloaded' .. '\n' )
- S = nil
- end
- -- Detours --
- function S.Detour( name, oldfunc, newfunc )
- S.Detours[ "OldFunctions" ][ name ] = oldfunc
- local dfunc = function( ... )
- newfunc( ... )
- return oldfunc( ... )
- end
- return dfunc
- end
- function S.DoDetourStuff( name, func, argtyp )
- local prefix = "lmao"
- local typ = argtyp or "Created"
- MsgC( Color( 75, 120, 255 ), prefix .. ' - ', Color( 75, 136, 255 ), typ .. ' detour "' .. name .. '"' .. '\n' )
- if ( func ) then
- func( name )
- else
- return prefix
- end
- end
- -- Hooking --
- local function DetouredHookCall( name, ... )
- if ( S.Hooks[ name ] ) then
- S.Hooks[ name ]( ... )
- end
- end
- S.DoDelayed( DELAY_DETOUR, "hook.Call", function( name )
- hook.Call = S.Detour( name, hook.Call, DetouredHookCall )
- end )
- -- Font --
- S.DoDelayed( DELAY_NONE, "CreateFont", function()
- surface.CreateFont( "yolo", S.FontMenu )
- surface.CreateFont( ":^)", S.FontESP )
- end )
- -- ESP --
- function S.ESP()
- local name_enabled = S.GetMenuSetting( "esp", "name" )
- local health_enabled = S.GetMenuSetting( "esp", "health" )
- local rank_enabled = S.GetMenuSetting( "esp", "rank" )
- local box_enabled = S.GetMenuSetting( "esp", "box" )
- if not ( name_enabled ) and not ( health_enabled ) and not ( rank_enabled ) and not ( box_enabled ) then
- return
- end
- local w = pcall( function() -- test da font 2 make suer it werkededs:)
- draw.DrawText( "", ":^)", 0, 0, Color( 255, 255, 255, 255 ) )
- end )
- if not ( w ) then
- return
- end
- for k, v in pairs( player.GetAll() ) do
- if ( v == LocalPlayer() ) then continue end
- if ( v:Health() <= 0 ) then continue end
- if ( v:GetColor().a < 255 ) then continue end
- local pos = v:GetPos():ToScreen() or cam.End3D2D()
- local nick = v:Nick() or ""
- local health = v:Health() or 0
- local rank = v:GetUserGroup() or ""
- local coln = team.GetColor( v:Team() ) or Color( 255, 255, 255, 255 )
- local colh = HSVToColor( health / 100 * 120, 1, 1 ) or Color( 255, 255, 255, 255 )
- local colr = ( rank ~= "user" and Color( 128, 128, 0, 255 ) ) or Color( 0, 255, 0, 255 )
- if ( name_enabled ) and not ( health_enabled ) and not ( rank_enabled ) then
- elseif ( rank_enabled ) and not ( name_enabled ) and not ( health_enabled ) then
- elseif ( name_enabled ) and ( rank_enabled ) and not ( health_enabled ) then
- nick = nick .. "|"
- else
- nick = nick .. "|"
- health = "(" .. tostring( health ) .. ")"
- rank = "|" .. rank
- end
- local incr = 0
- local old_x = pos.x
- surface.SetFont( ":^)" )
- local nick_w = ( name_enabled and select( 1, surface.GetTextSize( nick ) ) ) or 0
- local health_w = ( health_enabled and select( 1, surface.GetTextSize( health ) ) ) or 0
- local rank_w = ( rank_enabled and select( 1, surface.GetTextSize( rank ) ) ) or 0
- pos.x = pos.x - ( nick_w + health_w + rank_w ) / 2
- if ( name_enabled ) then
- draw.DrawText( nick, ":^)", pos.x + incr, pos.y, coln, TEXT_ALIGN_LEFT )
- incr = incr + nick_w
- end
- if ( health_enabled ) then
- draw.DrawText( health, ":^)", pos.x + incr, pos.y, colh, TEXT_ALIGN_LEFT )
- incr = incr + health_w
- end
- if ( rank_enabled ) then
- draw.DrawText( rank, ":^)", pos.x + incr, pos.y, colr, TEXT_ALIGN_LEFT )
- end
- pos.x = old_x
- -- warning if u r reading the codes below u r gay cause i dId not make them til i make my own box esp ... OK! i am copy paste king u dont dney :)
- if ( box_enabled ) then
- local Min, Max = v:GetCollisionBounds()
- local one = v:LocalToWorld(Min):ToScreen()
- local two = v:LocalToWorld(Vector(Min.x, Min.y, Max.z)):ToScreen()
- local three = v:LocalToWorld(Vector(Min.x, Min.y + (Max.y * 2), Min.z)):ToScreen()
- local four = v:LocalToWorld(Vector(Min.x + (Max.x * 2), Min.y, Min.z)):ToScreen()
- local five = v:LocalToWorld(Max):ToScreen()
- local six = v:LocalToWorld(Vector(Max.x, Max.y, Min.z)):ToScreen()
- local seven = v:LocalToWorld(Vector(Max.x, Max.y + (Min.y * 2), Max.z)):ToScreen()
- local eight = v:LocalToWorld(Vector(Max.x + (Min.x * 2), Max.y, Max.z)):ToScreen()
- surface.SetDrawColor(coln)
- local function connect(tabone, tabtwo)
- surface.DrawLine(tabone.x, tabone.y, tabtwo.x, tabtwo.y)
- end
- connect(one, two)
- connect(three, eight)
- connect(four, seven)
- connect(six, five)
- connect(four, six)
- connect(four, one)
- connect(one, three)
- connect(three, six)
- connect(five, eight)
- connect(eight, two)
- connect(two, seven)
- connect(seven, five)
- end
- end
- end
- -- !!! WARNING !!! everyting belowe da codens r lazy l0l ;^)
- -- Menu [ (name/enabled/length) ] --
- local MenuParents = {
- [ 1 ] = {
- [ "Name" ] = "aimbot",
- [ "LongestWidth" ] = 0,
- [ "Elements" ] = {
- { "abcdefeeea", false, 0 };
- { "abcdefe", false, 0 };
- }
- },
- [ 2 ] = {
- [ "Name" ] = "esp",
- [ "LongestWidth" ] = 0,
- [ "Elements" ] = {
- { "name", false, 0 };
- { "health", false, 0 };
- { "rank", false, 0 };
- { "box", false, 0 };
- }
- },
- [ 3 ] = {
- [ "Name" ] = "visuals",
- [ "LongestWidth" ] = 0,
- [ "Elements" ] = {
- { "abcdefasdfasfd", false, 0 };
- { "abcdefffffffffff", false, 0 };
- { "abcdeddf", false, 0 };
- }
- },
- [ 4 ] = {
- [ "Name" ] = "misc",
- [ "LongestWidth" ] = 0,
- [ "Elements" ] = {
- { "abcdfdfddef", false, 0 };
- { "abcdeasdf", false, 0 };
- { "abcfdddef", false, 0 };
- { "abcfdddef", false, 0 };
- { "heeeeeeeeeeeeeey", false, 0 };
- }
- }
- }
- function S.FindParentByName( name )
- for k, v in pairs( MenuParents ) do
- if ( v[ "Name" ] == name ) then
- return v
- end
- end
- end
- function S.GetMenuSetting( sub, name )
- local tab = S.FindParentByName( sub )
- if ( tab ) then
- for i = 1, #tab[ "Elements" ] do
- if ( tab[ "Elements" ][ i ][ 1 ] == name ) then
- return tab[ "Elements" ][ i ][ 2 ]
- end
- end
- end
- end
- S.DoDelayed( DELAY_NONE, "GetHighs", function() -- this should be named GetWidths etc but wat do i cereal
- local highs = {}
- for k, v in pairs( MenuParents ) do
- local elements = v[ "Elements" ]
- for l, b in pairs( elements ) do
- surface.SetFont( "yolo" )
- local w = select( 1, surface.GetTextSize( b[ 1 ] ) )
- MenuParents[ k ][ "Elements" ][ l ][ 3 ] = w
- highs[ k ] = highs[ k ] or {}
- highs[ k ][ l ] = w
- end
- end
- local high = 0
- for k, v in pairs( highs ) do
- for l, b in pairs( v ) do
- if ( b > high ) then
- high = b
- end
- if ( l == #v ) then
- MenuParents[ k ][ "LongestWidth" ] = high
- end
- end
- end
- end )
- local open = false
- local WaitTime = 0
- local LWaitTime = 0
- local cur = 1
- local ocur = 0
- local curn = -1
- local curnmt = 0
- local cursub = {}
- local open_delay = 0.5
- local switch_delay = 0.175
- local function DrawMenuText( text, offset )
- draw.SimpleText( text, "yolo", 5 + 1, ScrH() / 4 + 50 + offset + 1, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT )
- draw.SimpleText( text, "yolo", 5, ScrH() / 4 + 50 + offset, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- end
- local function DrawSubText( text, offset )
- draw.SimpleText( text, "yolo", 210 + 1, ScrH() / 4 + 50 + offset + 1, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT )
- draw.SimpleText( text, "yolo", 210, ScrH() / 4 + 50 + offset, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- end
- local function CalculateNextPosition( n, t, h ) -- number, type, high
- if not ( ( n == h and t == 1 ) ) and not ( ( n == 1 and t == 2 ) ) then
- n = ( ( t == 1 ) and ( n + 1 ) or ( n - 1 ) )
- else
- if ( n == h ) then
- n = 1
- else
- n = h
- end
- end
- return n
- end
- function S.Hooks.DrawOverlay()
- S.ESP()
- if ( input.IsKeyDown( KEY_DELETE ) ) then
- S.ShutDown()
- return
- end
- if ( RealTime() > WaitTime ) and ( input.IsKeyDown( KEY_INSERT ) ) then
- WaitTime = RealTime() + open_delay
- open = not open
- end
- if not ( open ) then
- return
- end
- local w = 200
- local h = 50
- if ( RealTime() > LWaitTime ) then
- if ( ( input.IsKeyDown( KEY_UP ) or ( input.IsKeyDown( KEY_DOWN ) ) ) ) then
- LWaitTime = RealTime() + switch_delay
- local typ = input.IsKeyDown( KEY_DOWN ) and 1 or 2
- local high = cur ~= -1 and #MenuParents or #cursub
- if ( cur == -1 ) then
- curnmt = CalculateNextPosition( curnmt, typ, high )
- else
- cur = CalculateNextPosition( cur, typ, high )
- end
- end
- if ( input.IsKeyDown( KEY_RIGHT ) ) then
- LWaitTime = RealTime() + ( switch_delay * 1.5 )
- if ( cur ~= -1 ) then
- curn = cur
- ocur = cur
- cur = -1
- curnmt = 1
- cursub = MenuParents[ ocur ][ "Elements" ]
- else
- MenuParents[ ocur ][ "Elements" ][ curnmt ][ 2 ] = not MenuParents[ ocur ][ "Elements" ][ curnmt ][ 2 ]
- end
- end
- if ( input.IsKeyDown( KEY_LEFT ) ) then
- LWaitTime = RealTime() + switch_delay
- if ( curn ~= -1 ) then
- curn = -1
- cur = ocur
- end
- end
- end
- for i, v in pairs( MenuParents ) do
- surface.SetDrawColor( 192, 192, 192, 200 )
- for m = 1, #MenuParents do
- if ( i == m ) then
- if ( ( cur ~= -1 and cur or ocur ) == m ) then
- surface.SetDrawColor( 5, 5, 5, 200 )
- else
- surface.SetDrawColor( 192, 192, 192, 200 )
- end
- surface.DrawRect( -1, ScrH() / 4 + ( i * h ), w, h )
- end
- end
- end
- if ( curn ~= -1 ) then
- local elements = cursub
- local subnum = 0
- for i = 1, #elements do
- local hwidth = MenuParents[ ocur ][ "LongestWidth" ] + 16
- local cursubelm = elements[ i ]
- if ( curnmt == i ) then
- surface.SetDrawColor( 5, 5, 5, 200 )
- else
- surface.SetDrawColor( 192, 192, 192, 200 )
- end
- surface.DrawRect( -1 + w, ScrH() / 4 + ( i * h ), hwidth, h )
- DrawSubText( cursubelm[ 1 ], subnum - 5 )
- if ( cursubelm[ 2 ] ) then
- surface.SetDrawColor( 0, 255, 0, 155 )
- else
- surface.SetDrawColor( 255, 0, 0, 155 )
- end
- surface.DrawRect( -1 + w, ScrH() / 4 + ( i * h ), 8, h )
- subnum = subnum + h
- end
- end
- local stepnum = 0
- for i = 1, #MenuParents do
- DrawMenuText( MenuParents[ i ][ "Name" ], stepnum - 5 )
- stepnum = stepnum + h
- end
- end
- S.Init()
Advertisement
Add Comment
Please, Sign In to add comment