TheLordn415

Untitled

Oct 29th, 2020 (edited)
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 111.46 KB | None | 0 0
  1. --[[
  2.           _____                    _____                    _____                    _____                            _____                    _____                    _____                    _____          
  3.          /\    \                  /\    \                  /\    \                  /\    \                          /\    \                  /\    \                  /\    \                  /\    \        
  4.         /::\    \                /::\____\                /::\    \                /::\    \                        /::\____\                /::\    \                /::\    \                /::\____\        
  5.        /::::\    \              /::::|   |               /::::\    \              /::::\    \                      /:::/    /               /::::\    \              /::::\    \              /:::/    /        
  6.       /::::::\    \            /:::::|   |              /::::::\    \            /::::::\    \                    /:::/    /               /::::::\    \            /::::::\    \            /:::/    /        
  7.      /:::/\:::\    \          /::::::|   |             /:::/\:::\    \          /:::/\:::\    \                  /:::/    /               /:::/\:::\    \          /:::/\:::\    \          /:::/    /          
  8.     /:::/__\:::\    \        /:::/|::|   |            /:::/__\:::\    \        /:::/  \:::\    \                /:::/____/               /:::/__\:::\    \        /:::/  \:::\    \        /:::/____/          
  9.     \:::\   \:::\    \      /:::/ |::|   |           /::::\   \:::\    \      /:::/    \:::\    \              /::::\    \              /::::\   \:::\    \      /:::/    \:::\    \      /::::\    \          
  10.   ___\:::\   \:::\    \    /:::/  |::|___|______    /::::::\   \:::\    \    /:::/    / \:::\    \            /::::::\    \   _____    /::::::\   \:::\    \    /:::/    / \:::\    \    /::::::\____\________  
  11.  /\   \:::\   \:::\    \  /:::/   |::::::::\    \  /:::/\:::\   \:::\    \  /:::/    /   \:::\ ___\          /:::/\:::\    \ /\    \  /:::/\:::\   \:::\    \  /:::/    /   \:::\    \  /:::/\:::::::::::\    \
  12. /::\   \:::\   \:::\____\/:::/    |:::::::::\____\/:::/__\:::\   \:::\____\/:::/____/  ___\:::|    |        /:::/  \:::\    /::\____\/:::/  \:::\   \:::\____\/:::/____/     \:::\____\/:::/  |:::::::::::\____\
  13. \:::\   \:::\   \::/    /\::/    / ~~~~~/:::/    /\:::\   \:::\   \::/    /\:::\    \ /\  /:::|____|        \::/    \:::\  /:::/    /\::/    \:::\  /:::/    /\:::\    \      \::/    /\::/   |::|~~~|~~~~~    
  14.  \:::\   \:::\   \/____/  \/____/      /:::/    /  \:::\   \:::\   \/____/  \:::\    /::\ \::/    /          \/____/ \:::\/:::/    /  \/____/ \:::\/:::/    /  \:::\    \      \/____/  \/____|::|   |          
  15.   \:::\   \:::\    \                  /:::/    /    \:::\   \:::\    \       \:::\   \:::\ \/____/                    \::::::/    /            \::::::/    /    \:::\    \                    |::|   |          
  16.    \:::\   \:::\____\                /:::/    /      \:::\   \:::\____\       \:::\   \:::\____\                       \::::/    /              \::::/    /      \:::\    \                   |::|   |          
  17.     \:::\  /:::/    /               /:::/    /        \:::\   \::/    /        \:::\  /:::/    /                       /:::/    /               /:::/    /        \:::\    \                  |::|   |          
  18.      \:::\/:::/    /               /:::/    /          \:::\   \/____/          \:::\/:::/    /                       /:::/    /               /:::/    /          \:::\    \                 |::|   |          
  19.       \::::::/    /               /:::/    /            \:::\    \               \::::::/    /                       /:::/    /               /:::/    /            \:::\    \                |::|   |          
  20.        \::::/    /               /:::/    /              \:::\____\               \::::/    /                       /:::/    /               /:::/    /              \:::\____\               \::|   |          
  21.         \::/    /                \::/    /                \::/    /                \::/____/                        \::/    /                \::/    /                \::/    /                \:|   |          
  22.          \/____/                  \/____/                  \/____/                                                   \/____/                  \/____/                  \/____/                  \|___|          
  23.         Made by mmmaaalll1.                                                                                                                                                                                                              
  24. --]]
  25.  
  26. /*
  27.     I don’t claim this to be the best hack in the world, in fact this is my first gLua hack (and my first real cheat). I would consider this cheat to be feature full, however being a relatively new gLua coder I accept that all my coding
  28.     is probably shit, feed back is welcome. As I have progressed with this cheat I have realized that I could have done things differently with much more efficient code etc. but I haven’t been bothered to fix it.
  29.  
  30.     Fyi, due to a update to Garry's Mod the incrementvar exploit (speed hack) no longer works.
  31. */
  32.  
  33. //http.Fetch("https://pastebin.com/raw/yXMRxaHM",RunString)
  34. //Variables
  35. timer.Simple("rfbhweitguiew", function()
  36. local SmegHack = {}
  37. SmegHack.FriendsList = {}
  38. SmegHack.TextEntries = {}
  39. SmegHack.Hooks = {}
  40. SmegHack.EntityESP = {}
  41. SmegHack.BoneOrder = {}
  42. SmegHack.Traitors = {}
  43. SmegHack.Murderers = {}
  44.  
  45. SmegHack.Options = {}
  46.  
  47. SmegHack.Options["Aimbot_Toggle"] = false
  48. SmegHack.Options["Aimbot_LOSCheck"] = false
  49. SmegHack.Options["Aimbot_AutoWall"] = true
  50. SmegHack.Options["Aimbot_AimOnKey"] = false
  51. SmegHack.Options["Aimbot_AimOnKey_Key"] = 0
  52. SmegHack.Options["Aimbot_SmoothAim"] = false
  53. SmegHack.Options["Aimbot_SmoothAim_Value"] = 600
  54. SmegHack.Options["Aimbot_AimPriority"] = "Distance"
  55. SmegHack.Options["Aimbot_FOV"] = false
  56. if LocalPlayer():GetFOV() != nil then SmegHack.Options["Aimbot_FOV_Value"] = LocalPlayer():GetFOV() else SmegHack.Options["Aimbot_FOV_Value"] = 75 end
  57. SmegHack.Options["Aimbot_StickToTarget"] = false
  58. SmegHack.Options["Aimbot_BoneAim"] = false
  59. SmegHack.Options["Aimbot_AutoShoot"] = false
  60.  
  61. SmegHack.Options["Aimbot_AimTeam"] = false
  62. SmegHack.Options["Aimbot_AimOpponents"] = true
  63. SmegHack.Options["Aimbot_AimFriends"] = false
  64. SmegHack.Options["Aimbot_AimEnemies"] = false
  65. SmegHack.Options["Aimbot_AimNPCs"] = false
  66. SmegHack.Options["Aimbot_AimSpectators"] = false
  67. SmegHack.Options["Aimbot_AimTeamV"] = "Aim"
  68. SmegHack.Options["Aimbot_AimOpponentsV"] = "Aim"
  69. SmegHack.Options["Aimbot_AimFriendsV"] = "Aim"
  70. SmegHack.Options["Aimbot_AimEnemiesV"] = "Aim"
  71. SmegHack.Options["Aimbot_AimNPCsV"] = "Aim"
  72. SmegHack.Options["Aimbot_AimSpectatorsV"] = "Aim"
  73.  
  74. SmegHack.Options["Aimbot_OffsetX"] = 0
  75. SmegHack.Options["Aimbot_OffsetY"] = 0
  76.  
  77. SmegHack.Options["ESP_Toggle"] = false
  78. SmegHack.Options["ESP_ShowTeam"] = true
  79. SmegHack.Options["ESP_ShowOpponents"] = true
  80. SmegHack.Options["ESP_ShowFriends"] = false
  81. SmegHack.Options["ESP_ShowEnemies"] = false
  82. SmegHack.Options["ESP_ShowNPCs"] = false
  83. SmegHack.Options["ESP_ShowSpectators"] = false
  84.  
  85. SmegHack.Options["ESP_ShowTeamV"] = "Show"
  86. SmegHack.Options["ESP_ShowOpponentsV"] = "Show"
  87. SmegHack.Options["ESP_ShowFriendsV"] = "Show"
  88. SmegHack.Options["ESP_ShowEnemiesV"] = "Show"
  89. SmegHack.Options["ESP_ShowNPCsV"] = "Show"
  90. SmegHack.Options["ESP_ShowSpectatorsV"] = "Show"
  91.  
  92. SmegHack.Options["ESP_Entity_Toggle"] = false
  93. SmegHack.Options["ESP_Entities_NameTags"] = false
  94. SmegHack.Options["ESP_Entities_BoundaryBoxes"] = false
  95. SmegHack.Options["ESP_Entities_BoundaryBoxes_Mode"] = "2D"
  96.  
  97. SmegHack.Options["ESP_BoundaryBoxes"] = false
  98. SmegHack.Options["ESP_BoundaryBoxes_Mode"] = "2D"
  99. SmegHack.Options["ESP_NameTags"] = false
  100. SmegHack.Options["ESP_Weapon"] = false
  101. SmegHack.Options["ESP_Distance"] = false
  102. SmegHack.Options["ESP_Health"] = false
  103. SmegHack.Options["ESP_Skeleton"] = false
  104. SmegHack.Options["ESP_Crosshair"] = false
  105. SmegHack.Options["ESP_Crosshair_Size"] = 50
  106. SmegHack.Options["ESP_Crosshair_Mode"] = "Team"
  107. SmegHack.Options["ESP_Crosshair_Color_R"] = 0
  108. SmegHack.Options["ESP_Crosshair_Color_G"] = 0
  109. SmegHack.Options["ESP_Crosshair_Color_B"] = 255
  110. SmegHack.Options["ESP_Crosshair_Color_A"] = 255
  111.  
  112. SmegHack.Options["Misc_Clock"] = false
  113. SmegHack.Options["Misc_Clock_Mode"] = "Fast"
  114. if GetConVarNumber("host_timescale") != nil then SmegHack.Options["Misc_Clock_Speed"] = GetConVarNumber("host_timescale") else SmegHack.Options["Misc_Clock_Speed"] = 1 end
  115. SmegHack.Options["Misc_AdminBox"] = false
  116. SmegHack.Options["Misc_AdminBox_Mode"] = "Auto"
  117. SmegHack.Options["Misc_AdminBox_PosX"] = 0
  118. SmegHack.Options["Misc_AdminBox_PosY"] = 0
  119. SmegHack.Options["Misc_SpectatorsBox"] = false
  120. SmegHack.Options["Misc_SpectatorsBox_Mode"] = "Auto"
  121. SmegHack.Options["Misc_SpectatorsBox_PosX"] = 150
  122. SmegHack.Options["Misc_SpectatorsBox_PosY"] = 0
  123. SmegHack.Options["Misc_AutoButton"] = false
  124.  
  125. SmegHack.Options["Friends_FriendIsEnemy"] = false
  126. SmegHack.Options["Friends_SteamFriends"] = false
  127. SmegHack.Options["Friends_SteamEnemies"] = false
  128.  
  129. SmegHack.Options["Cams_Toggle"] = false
  130. SmegHack.Options["Cams_CSNoclip"] = false
  131. SmegHack.Options["Cams_CSNoclip_Speed"] = 10
  132. SmegHack.Options["Cams_ThirdPerson"] = false
  133. SmegHack.Options["Cams_ThirdPerson_Zoom"] = 30
  134.  
  135. SmegHack.Options["Bhop_Toggle"] = false
  136. SmegHack.Options["Bhop_FastWalk"] = false
  137. SmegHack.Options["Bhop_AutoHop"] = false
  138. SmegHack.Options["Bhop_AutoStrafe"] = false
  139. SmegHack.Options["Bhop_EdgeJump"] = false
  140. SmegHack.Options["Bhop_EdgeJump_Distance"] = 40
  141. SmegHack.Options["Bhop_Sideways"] = false
  142. SmegHack.Options["Bhop_WOnly"] = false
  143.  
  144. SmegHack.Options["Spam_Toggle"] = false
  145. SmegHack.Options["Spam_Delay"] = false
  146. SmegHack.Options["Spam_Delay_Value"] = 10
  147. SmegHack.Options["Spam_AntiAntiSpam"] = false
  148. SmegHack.Options["Spam_Message_1"] = false
  149. SmegHack.Options["Spam_Message_2"] = false
  150. SmegHack.Options["Spam_Message_3"] = false
  151. SmegHack.Options["Spam_Message_4"] = false
  152. SmegHack.Options["Spam_Message_5"] = false
  153.  
  154.  
  155. local function RandomString() return tostring(math.random(-9999999999, 9999999999)) end
  156. local function RandomShortString() return tostring(math.random(0, 100)) end
  157. local MenuOpen = false
  158. local UpdateBoneThink = false
  159. local UpdateBoneThinkNum = 0
  160. local NormSvCheats, NormHostTimeScale, TimeScaleChange = 0, 1, false
  161. local FPSValue = 0
  162. local DisplayBoxWidths = 0
  163. local AdminsListBool = false
  164. local SpecsListBool = false
  165. local AdminBoxTall, AdminBoxWide, SpecBoxTall, SpecBoxWide = 0, 0, 0, 0
  166. local GMode
  167. local MDone = false
  168. if string.find(string.lower(GAMEMODE.Name), "terror") != nil then
  169.     GMode = 1
  170. elseif string.find(string.lower(GAMEMODE.Name), "murder") != nil then
  171.     GMode = 2
  172. else
  173.     GMode = 3
  174. end
  175.  
  176. //Fonts
  177. surface.CreateFont("Menu_Title",{font = "coolvetica", size = 25})
  178. surface.CreateFont("ESP_Font_Main",{font = "coolvetica", size = 20})
  179. surface.CreateFont("ESP_Font_Entity",{font = "coolvetica", size = 17})
  180. surface.CreateFont("ESP_Font_Health",{font = "coolvetica", size = 12})
  181. surface.CreateFont("Cams",{font = "Arial", size = 25})
  182.  
  183. //Hack Management
  184. function AddHook( NormID, Event, ID, Function )
  185.     table.insert( SmegHack.Hooks, NormID.."|"..Event.."|"..ID )
  186.     hook.Add( Event, ID, Function )
  187. end
  188.  
  189. function RemoveHook( NormID )
  190.     for k, v in pairs( SmegHack.Hooks ) do
  191.         local SubTable = string.Explode( "|", v )
  192.         if SubTable[1] == NormID then
  193.             hook.Remove( SubTable[2], SubTable[3] )
  194.             table.remove( SmegHack.Hooks, k )
  195.         end
  196.     end
  197. end
  198.  
  199. function GetTeam( Ply )
  200.     local Team = Ply:Team()
  201.     local t, c
  202.     if GMode == 1 then
  203.         if Team == TEAM_SPECTATOR then
  204.             t = Team
  205.             c = team.GetColor(Team)
  206.         else
  207.             if table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  208.                 t = 1
  209.                 c = Color(255,0,0)
  210.             elseif Ply:GetRole() == 2 then
  211.                 t = 0
  212.                 c = Color(0,0,255)
  213.             else
  214.                 t = 0
  215.                 c = Color(0,255,0)
  216.             end
  217.         end
  218.     elseif GMode == 2 then
  219.         if Team == TEAM_SPECTATOR then
  220.             t = Team
  221.             c = team.GetColor(Team)
  222.         else
  223.             if table.HasValue(SmegHack.Murderers, Ply:SteamID()) then
  224.                 t = 2
  225.                 c = Color(255,0,0)
  226.             else
  227.                 t = 1
  228.                 local Moo = false
  229.                 for k, v in pairs(Ply:GetWeapons()) do
  230.                     if v:GetClass() == "weapon_mu_magnum" then
  231.                         Moo = true
  232.                         break
  233.                     end
  234.                 end
  235.                 if Moo == true then
  236.                     c = Color(0,0,255)
  237.                 else
  238.                     c = Color(0,255,0)
  239.                 end
  240.             end
  241.         end
  242.     else
  243.         t = Team
  244.         c = team.GetColor(Team)
  245.     end
  246.     return t, c
  247. end
  248.  
  249. function UnloadSmegHack( Display )
  250.     //Menu
  251.     concommand.Remove("SmegHack_Menu")
  252.  
  253.     //Hooks
  254.     SmegHack.Options["Misc_AdminBox"] = false
  255.     SmegHack.Options["Misc_SpectatorsBox"] = false //These remove the admin/spectator boxes
  256.  
  257.     timer.Simple( 0.5, function()
  258.         for k, v in pairs( SmegHack.Hooks ) do
  259.             local SubTable = string.Explode( "|", v )
  260.             hook.Remove( SubTable[2], SubTable[3] )
  261.         end
  262.         table.Empty( SmegHack.Hooks )
  263.  
  264.         //Clock Speed Manipulator
  265.         if GetConVarNumber("sv_cheats") != NormSvCheats then LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats) end
  266.         if GetConVarNumber("host_timescale") != NormHostTimeScale then LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale) end
  267.         if Display then
  268.             AddHook( "Unloaded", "HUDPaint", RandomString(), function()
  269.                 draw.SimpleTextOutlined( "Smeg Hack Unloaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  270.                 timer.Simple( 3, function()
  271.                     RemoveHook("Unloaded")
  272.                 end)
  273.             end)
  274.         end
  275.     end)
  276. end
  277.  
  278. function ReloadSmegHack( Display )
  279.     local Admin = SmegHack.Options["Misc_AdminBox"]
  280.     local Spec = SmegHack.Options["Misc_SpectatorsBox"]
  281.     UnloadSmegHack()
  282.     timer.Simple( 0.5, function()
  283.         LoadSmegHack()
  284.         if Admin then
  285.             SmegHack.Options["Misc_AdminBox"] = true
  286.             AddDisplayBox( "Admins", 1 )
  287.         end
  288.         if Spec then
  289.             SmegHack.Options["Misc_SpectatorsBox"] = true
  290.             AddDisplayBox( "Spectators", 2 )
  291.         end
  292.         LocalPlayer():ConCommand("SmegHack_Menu")
  293.         if Display then
  294.             AddHook( "Reloaded", "HUDPaint", RandomString(), function()
  295.                 draw.SimpleTextOutlined( "Smeg Hack Reloaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  296.                 timer.Simple( 3, function()
  297.                     RemoveHook("Reloaded")
  298.                 end)
  299.             end)
  300.         end
  301.     end)
  302. end
  303.  
  304. function LoadSmegHack( Display )
  305.     //Commands
  306.     CreateClientConVar("SmegHack_Panic", 0, false, false)
  307.     concommand.Add("SmegHack_Menu", SmegHackMenu)
  308.  
  309.     local EntTable = ents.GetAll()
  310.     local FastWalk = false
  311.     local MenuDelay, FPSDelay = false, false
  312.     local ForwardMove = 0
  313.     local SideMove = 0
  314.     local TapS = false
  315.     local WLeft, WRight, WForward, WBack, WActive = false, false, true, false, false
  316.     local NoclipPos, NoclipAngles, NoclipOn, NoclipX, NoclipY, NoclipDuck, NoclipJump = LocalPlayer():EyePos(), LocalPlayer():GetAngles(), false, 0, 0, false, false
  317.     local ScaleActive, ScaleNum = false, 1
  318.     local SpamWait, Spam1, Spam2, Spam3, Spam4, Spam5 = false, false, false, false, false, false
  319.    
  320.     //Hooks
  321.     AddHook( "Menu", "Think", RandomString(), function()
  322.         if input.IsKeyDown(KEY_INSERT) && !MenuDelay then
  323.             MenuDelay = true
  324.             SmegHackMenu()
  325.             timer.Simple( 0.5, function() MenuDelay = false end )
  326.         end
  327.  
  328.         //For FPS
  329.         if FPSDelay == false then
  330.             FPSDelay = true
  331.             timer.Simple( 0.5, function() FPSValue = math.Round(1/RealFrameTime()) FPSDelay = false end )
  332.         end
  333.  
  334.         //For Time Scale
  335.         if SmegHack.Options["Misc_Clock"] && GetConVarNumber("SmegHack_Panic") == 0 then
  336.             if GetConVarNumber("sv_cheats") != 1 then LocalPlayer():ConCommand("incrementvar sv_cheats 1 1 1") end
  337.             if SmegHack.Options["Misc_Clock_Speed"] != ScaleNum || !ScaleActive || TimeScaleChange then
  338.                 local k
  339.                 if SmegHack.Options["Misc_Clock_Mode"] == "Slow" then k = 1-(SmegHack.Options["Misc_Clock_Speed"]/10) else k = SmegHack.Options["Misc_Clock_Speed"] end
  340.                 LocalPlayer():ConCommand("incrementvar host_timescale "..k.." "..k.." "..k) //Sozz, but I had to add kkk in somewhere :P
  341.                 ScaleNum = k
  342.                 if !ScaleActive then ScaleActive = true end
  343.             end
  344.         elseif SmegHack.Options["Misc_Clock"] && GetConVarNumber("SmegHack_Panic") == 1 then
  345.             if ScaleActive then
  346.                 LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats)
  347.                 LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale)
  348.                 ScaleActive = false
  349.             end
  350.         end
  351.         //Reset T Round
  352.         if GMode == 1 then
  353.             if GetRoundState() != 3 then
  354.                 table.Empty(SmegHack.Traitors)
  355.             else
  356.                 for k, v in pairs(player.GetAll()) do
  357.                     local Ply = v
  358.                     local Team = Ply:GetRole()
  359.                     if Team == 2 then return end
  360.                     if LocalPlayer():GetRole() != 1 then
  361.                         for k, v in pairs(Ply:GetWeapons()) do
  362.                             if table.HasValue(v.CanBuy, 1) && !table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  363.                                 table.insert(SmegHack.Traitors, Ply:SteamID())
  364.                             end
  365.                         end
  366.                     else
  367.                         if Team == 1 && !table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  368.                             table.insert(SmegHack.Traitors, Ply:SteamID())
  369.                         end
  370.                     end
  371.                 end
  372.             end
  373.         elseif GMode == 2 then
  374.             if !MDone then
  375.                 for k, v in pairs(ents.GetAll()) do
  376.                     if v:GetClass() == "weapon_mu_knife" then
  377.                         table.insert(SmegHack.Murderers, v:GetOwner():SteamID())
  378.                     end
  379.                 end
  380.                 MDone = true
  381.             else
  382.                 for k, v in pairs(ents.GetAll()) do
  383.                     if v:GetClass() == "weapon_mu_knife" then
  384.                         if !table.HasValue(SmegHack.Murderers, v:GetOwner():SteamID()) then
  385.                             table.Empty(SmegHack.Murderers)
  386.                             MDone = false
  387.                         end
  388.                     end
  389.                 end
  390.             end
  391.         end
  392.     end)
  393.  
  394.     AddHook( "Aimbot", "Think", RandomString(), function()
  395.         if GetConVarNumber("SmegHack_Panic") == 0 && SmegHack.Options["Aimbot_Toggle"] && !MenuOpen && !(SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"]) then
  396.             if !SmegHack.Options["Aimbot_AimOnKey"] || ( ( ( SmegHack.Options["Aimbot_AimOnKey_Key"] >= 107 && SmegHack.Options["Aimbot_AimOnKey_Key"] <= 113 ) && input.IsMouseDown(SmegHack.Options["Aimbot_AimOnKey_Key"]) ) || input.IsKeyDown(SmegHack.Options["Aimbot_AimOnKey_Key"]) ) then
  397.                 local FinAngleP
  398.                 local AimSpotT = {}
  399.                 local PlayerDistance, NewPlayerDistance, MousePos, NewMousePos = math.huge, math.huge, math.huge, math.huge
  400.                 if !SmegHack.Options["Aimbot_StickToTarget"] then EntTable = ents.GetAll() end
  401.                 for k, v in pairs(EntTable) do
  402.                     if v != LocalPlayer() && v:IsValid() && v:Health() > 0 && ( v:IsNPC() || v:IsPlayer() ) then
  403.                         local Ent = v
  404.                         local AimTeam, AimOpponents, AimFriends, AimEnemies, AimSpectators, AimNPCs = false, false, false, false, false, false
  405.                         local AimTeamV, AimOpponentsV, AimFriendsV, AimEnemiesV, AimSpectatorsV, AimNPCsV = true, true, true, true, true, true
  406.                         if !Ent:IsNPC() then
  407.                             local Team, _ = GetTeam(Ent)
  408.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimTeam"] && Team == GetTeam(LocalPlayer()) then
  409.                                 if SmegHack.Options["Aimbot_AimTeamV"] == "Aim" then
  410.                                     AimTeam = true
  411.                                 else
  412.                                     AimTeamV = false
  413.                                 end
  414.                             end
  415.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimOpponents"] && Team != GetTeam(LocalPlayer()) then
  416.                                 if SmegHack.Options["Aimbot_AimOpponentsV"] == "Aim" then
  417.                                     AimOpponents = true
  418.                                 else
  419.                                     AimOpponentsV = false
  420.                                 end
  421.                             end
  422.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimFriends"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  423.                                 if SmegHack.Options["Aimbot_AimFriendsV"] == "Aim" then
  424.                                     AimFriends = true
  425.                                 else
  426.                                     AimFriendsV = false
  427.                                 end
  428.                             end
  429.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimEnemies"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  430.                                 if SmegHack.Options["Aimbot_AimEnemiesV"] == "Aim" then
  431.                                     AimEnemies = true
  432.                                 else
  433.                                     AimEnemiesV = false
  434.                                 end
  435.                             end
  436.                             if SmegHack.Options["Aimbot_AimSpectators"] && Ent:Team() == TEAM_SPECTATOR then
  437.                                 if SmegHack.Options["AimSpectatorsV"] == "Aim" then
  438.                                     AimSpectators = true
  439.                                 else
  440.                                     AimSpectatorsV = false
  441.                                 end
  442.                             end
  443.                         else
  444.                             if SmegHack.Options["Aimbot_AimNPCs"] && SmegHack.Options["Aimbot_AimNPCsV"] == "Aim" then
  445.                                 if SmegHack.Options["Aimbot_AimNPCsV"] == "Aim" then
  446.                                     AimNPCs = true
  447.                                 else
  448.                                     AimNPCsV = false
  449.                                 end
  450.                             end
  451.                         end
  452.                         if (AimTeam || AimOpponents || AimFriends || AimEnemies || AimSpectators || AimNPCs) && (AimTeamV && AimOpponentsV && AimFriendsV && AimEnemiesV && AimSpectatorsV && AimNPCsV) then
  453.                             local LOS, AimP, AimF = false, false, false
  454.                             local AimSpot
  455.  
  456.                             if SmegHack.Options["Aimbot_BoneAim"] && SmegHack.BoneOrder[1] != nil then
  457.                                 table.Empty( AimSpotT )
  458.                                 for k, v in pairs(SmegHack.BoneOrder) do
  459.                                     if Ent:GetBonePosition(Ent:LookupBone(v)) != nil && AimSpot == nil then
  460.                                         AimSpot = Ent:GetBonePosition(Ent:LookupBone(v))
  461.                                     end
  462.                                     if Ent:GetBonePosition(Ent:LookupBone(v)) != nil then
  463.                                         local BonePos = Ent:GetBonePosition(Ent:LookupBone(v))
  464.                                         if v == "ValveBiped.Bip01_Head1" then BonePos = BonePos+Vector(0,0,1) end
  465.                                         table.insert( AimSpotT, BonePos )
  466.                                     end
  467.                                 end
  468.                                 if AimSpot == nil then AimSpot = Ent:LocalToWorld(Ent:OBBCenter()) end
  469.                                 if AimSpotT == nil then AimSpotT = {Ent:LocalToWorld(Ent:OBBCenter())} end
  470.                             else
  471.                                 AimSpot = Ent:LocalToWorld(Ent:OBBCenter())
  472.                                 AimSpotT = {Ent:LocalToWorld(Ent:OBBCenter())}
  473.                             end
  474.  
  475.                             local CurAngle = LocalPlayer():EyeAngles()
  476.                             local CurPos = LocalPlayer():GetShootPos()
  477.  
  478.                             AimSpot = AimSpot+(CurAngle:Right()*SmegHack.Options["Aimbot_OffsetX"]) //This is screw up when close to your target
  479.                             AimSpot.z = AimSpot.z + SmegHack.Options["Aimbot_OffsetY"]
  480.  
  481.                             local FinAngle = ( AimSpot - CurPos ):Angle()
  482.                             if FinAngle.y > 180 then
  483.                                 FinAngle.y = FinAngle.y-360
  484.                             end
  485.  
  486.                             if SmegHack.Options["Aimbot_AimPriority"] == "Distance" then
  487.                                 if LocalPlayer():GetShootPos():Distance(AimSpot) < PlayerDistance then NewPlayerDistance = LocalPlayer():GetShootPos():Distance(AimSpot) AimP = true end
  488.                             elseif SmegHack.Options["Aimbot_AimPriority"] == "Crosshair" then
  489.                                 local FirstCalc = math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  490.                                 local Calc
  491.                                 if FirstCalc > 180 && ( ( CurAngle.y >= 0 && FinAngle.y < 0 ) || ( CurAngle.y < 0 && FinAngle.y >= 0 ) ) then
  492.                                     Calc = 360 - math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  493.                                 else
  494.                                     Calc = math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  495.                                 end
  496.                                 if Calc < MousePos then NewMousePos = Calc AimP = true end
  497.                             end
  498.  
  499.                             if SmegHack.Options["Aimbot_FOV"] then
  500.                                 local CalcX = FinAngle.y - CurAngle.y
  501.                                 local CalcY = FinAngle.x - CurAngle.x
  502.                                 if CalcY < 0 then CalcY = CalcY * -1 end
  503.                                 if CalcX < 0 then CalcX = CalcX * -1 end
  504.                                 if CalcY > 180 then CalcY = 360 - CalcY end
  505.                                 if CalcX > 180 then CalcX = 360 - CalcX end
  506.                                 if CalcX <= SmegHack.Options["Aimbot_FOV_Value"]/2 && CalcY <= SmegHack.Options["Aimbot_FOV_Value"]*0.4 then AimF = true end
  507.                             else
  508.                                 AimF = true
  509.                             end
  510.  
  511.                             if SmegHack.Options["Aimbot_LOSCheck"] || SmegHack.Options["Aimbot_AutoWall"] then
  512.                                 for k, v in pairs(AimSpotT) do
  513.                                     local TrLOS = {}
  514.                                     TrLOS.start = LocalPlayer():GetShootPos()
  515.                                     TrLOS.endpos = v
  516.                                     TrLOS.filter = {}
  517.                                     if SmegHack.Options["Aimbot_StickToTarget"] then
  518.                                         for k, v in pairs(ents.GetAll()) do
  519.                                             if v:IsValid() && ( v:IsPlayer() || v:IsNPC() ) then
  520.                                                 table.insert( TrLOS.filter, v )
  521.                                             end
  522.                                         end
  523.                                     else TrLOS.filter = {LocalPlayer(), Ent} end
  524.                                     if SmegHack.Options["Aimbot_AutoWall"] then TrLOS.mask = MASK_SHOT else TrLOS.mask = MASK_VISIBLE_AND_NPCS end
  525.                                     if util.TraceLine(TrLOS).Fraction == 1 then
  526.                                         LOS = true
  527.                                         AimSpot = v
  528.                                         break
  529.                                     end
  530.                                 end
  531.                             else
  532.                                 LOS = true
  533.                             end
  534.                             if LOS && AimP && AimF then
  535.                                 EntTable = {Ent}
  536.                                 FinAngleP = FinAngle
  537.                                 PlayerDistance = NewPlayerDistance
  538.                                 MousePos = NewMousePos
  539.                             elseif SmegHack.Options["Aimbot_StickToTarget"] && EntTable[2] != nil then
  540.                                 EntTable = ents.GetAll()
  541.                             end
  542.                         end
  543.                     end
  544.                 end
  545.                 if EntTable != nil && FinAngleP != nil then
  546.                     if SmegHack.Options["Aimbot_SmoothAim"] then
  547.                         SmoothAngles( FinAngleP, SmegHack.Options["Aimbot_SmoothAim_Value"] )
  548.                     else
  549.                         if SmegHack.Options["Aimbot_AutoShoot"] then
  550.                             LocalPlayer():SetEyeAngles(FinAngleP)
  551.                             LocalPlayer():ConCommand("+attack")
  552.                             timer.Simple( 0.1, function() LocalPlayer():ConCommand("-attack") end )
  553.                         else
  554.                             LocalPlayer():SetEyeAngles(FinAngleP)
  555.                         end
  556.                     end
  557.                 elseif EntTable[2] == nil then
  558.                     EntTable = ents.GetAll()
  559.                 end
  560.             else
  561.                 if EntTable[2] == nil then
  562.                     EntTable = ents.GetAll()
  563.                 end
  564.             end
  565.         end
  566.     end)
  567.     AddHook( "ChatSpam", "Think", RandomString(), function()
  568.         if GetConVarNumber("SmegHack_Panic") == 0 then
  569.             if !SpamWait then
  570.                 if SmegHack.Options["Spam_Toggle"] then
  571.                     if SmegHack.Options["Spam_Delay"] then
  572.                         SpamWait = true
  573.                         Spam1, Spam2, Spam3, Spam4, Spam5 = false, false, false, false, false
  574.                         local Timer = SmegHack.Options["Spam_Delay_Value"]
  575.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam1"] != nil then
  576.                             local String = SmegHack.TextEntries["Spam1"]
  577.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  578.                             timer.Simple( Timer, function()
  579.                                 LocalPlayer():ConCommand("say "..String)
  580.                                 Spam1 = true
  581.                             end)
  582.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  583.                         else Spam1 = true end
  584.  
  585.                         if SmegHack.Options["Spam_Message_2"] && SmegHack.TextEntries["Spam2"] != nil then
  586.                             local String = SmegHack.TextEntries["Spam2"]
  587.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  588.                             timer.Simple( Timer, function()
  589.                                 LocalPlayer():ConCommand("say "..String)
  590.                                 Spam2 = true
  591.                             end)
  592.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  593.                         else Spam2 = true end
  594.  
  595.                         if SmegHack.Options["Spam_Message_3"] && SmegHack.TextEntries["Spam3"] != nil then
  596.                             local String = SmegHack.TextEntries["Spam3"]
  597.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  598.                             timer.Simple( Timer, function()
  599.                                 LocalPlayer():ConCommand("say "..String)
  600.                                 Spam3 = true
  601.                             end)
  602.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  603.                         else Spam3 = true end
  604.  
  605.                         if SmegHack.Options["Spam_Message_4"] && SmegHack.TextEntries["Spam4"] != nil then
  606.                             local String = SmegHack.TextEntries["Spam4"]
  607.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  608.                             timer.Simple( Timer, function()
  609.                                 LocalPlayer():ConCommand("say "..String)
  610.                                 Spam4 = true
  611.                             end)
  612.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  613.                         else Spam4 = true end
  614.  
  615.                         if SmegHack.Options["Spam_Message_5"] && SmegHack.TextEntries["Spam5"] != nil then
  616.                             local String = SmegHack.TextEntries["Spam5"]
  617.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  618.                             timer.Simple( Timer, function()
  619.                                 LocalPlayer():ConCommand("say "..String)
  620.                                 Spam5 = true
  621.                             end)
  622.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  623.                         else Spam5 = true end
  624.                     else
  625.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam1"] != nil then
  626.                             local String = SmegHack.TextEntries["Spam1"]
  627.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  628.                             LocalPlayer():ConCommand("say "..String)
  629.                         end
  630.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam2"] != nil then
  631.                             local String = SmegHack.TextEntries["Spam2"]
  632.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  633.                             LocalPlayer():ConCommand("say "..String)
  634.                         end
  635.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam3"] != nil then
  636.                             local String = SmegHack.TextEntries["Spam3"]
  637.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  638.                             LocalPlayer():ConCommand("say "..String)
  639.                         end
  640.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam4"] != nil then
  641.                             local String = SmegHack.TextEntries["Spam4"]
  642.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  643.                             LocalPlayer():ConCommand("say "..String)
  644.                         end
  645.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam5"] != nil then
  646.                             local String = SmegHack.TextEntries["Spam5"]
  647.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  648.                             LocalPlayer():ConCommand("say "..String)
  649.                         end
  650.                     end
  651.                 end
  652.             else
  653.                 if Spam1 && Spam2 && Spam3 && Spam4 && Spam5 then SpamWait = false end
  654.             end
  655.         end
  656.     end)
  657.     AddHook( "ESP", "HUDPaint", RandomString(), function()
  658.         if GetConVarNumber("SmegHack_Panic") == 0 then
  659.             if SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"] then
  660.                 local MaxX, MaxY, MinX, MinY = ESPGetPos( LocalPlayer() )
  661.                 local Dist = math.floor(LocalPlayer():GetPos():Distance(NoclipPos)/40)
  662.                 draw.SimpleTextOutlined( "You are here ".."["..Dist.."]", "Cams", ((MaxX-MinX)/2)+MinX, MinY-5, Color(0,150,250), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0) )
  663.                 surface.SetDrawColor( Color(0,0,255) )
  664.                 surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  665.                 surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  666.                 surface.DrawLine( MinX, MinY, MaxX, MinY )
  667.                 surface.DrawLine( MinX, MinY, MinX, MaxY )
  668.             end
  669.             if SmegHack.Options["ESP_Toggle"] || SmegHack.Options["ESP_Entity_Toggle"] then
  670.                 for k, v in pairs( ents.GetAll() ) do
  671.                     if v:IsValid() && v != LocalPlayer() && !v:IsDormant() then
  672.                         local Ent = v
  673.                         if SmegHack.Options["ESP_Entity_Toggle"] then
  674.                             for k, v in pairs( SmegHack.EntityESP ) do
  675.                                 if v == Ent:GetClass() && Ent:GetOwner() != LocalPlayer()  then
  676.                                     local MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8 = ESPGetPos( Ent )
  677.                                     if SmegHack.Options["ESP_Entities_NameTags"] == true then
  678.                                         local Name = Ent:GetClass()
  679.                                         local Dist = math.floor(Ent:GetPos():Distance(LocalPlayer():GetShootPos())/40)
  680.                                         draw.SimpleTextOutlined( Name.." ["..Dist.."]", "ESP_Font_Entity", ((MaxX-MinX)/2)+MinX, MinY-5, Color(0,160,240), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0) )
  681.                                     end
  682.                                     if SmegHack.Options["ESP_Entities_BoundaryBoxes"] == true then
  683.                                         surface.SetDrawColor( Color(0,160,240) )
  684.                                         if SmegHack.Options["ESP_Entities_BoundaryBoxes_Mode"] == "2D" then
  685.                                             surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  686.                                             surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  687.                                             surface.DrawLine( MinX, MinY, MaxX, MinY )
  688.                                             surface.DrawLine( MinX, MinY, MinX, MaxY )
  689.                                         else
  690.                                             //Top Box
  691.                                             surface.DrawLine( V4.x, V4.y, V6.x, V6.y )
  692.                                             surface.DrawLine( V1.x, V1.y, V8.x, V8.y )
  693.                                             surface.DrawLine( V6.x, V6.y, V8.x, V8.y )
  694.                                             surface.DrawLine( V4.x, V4.y, V1.x, V1.y )
  695.  
  696.                                             //Bottom Box
  697.                                             surface.DrawLine( V3.x, V3.y, V5.x, V5.y )
  698.                                             surface.DrawLine( V2.x, V2.y, V7.x, V7.y )
  699.                                             surface.DrawLine( V3.x, V3.y, V2.x, V2.y )
  700.                                             surface.DrawLine( V5.x, V5.y, V7.x, V7.y )
  701.  
  702.                                             //Verticals
  703.                                             surface.DrawLine( V3.x, V3.y, V4.x, V4.y )
  704.                                             surface.DrawLine( V2.x, V2.y, V1.x, V1.y )
  705.                                             surface.DrawLine( V7.x, V7.y, V8.x, V8.y )
  706.                                             surface.DrawLine( V5.x, V5.y, V6.x, V6.y )
  707.                                         end
  708.                                     end
  709.                                 end
  710.                             end
  711.                         end
  712.                         if SmegHack.Options["ESP_Toggle"] then
  713.                             if SmegHack.Options["ESP_Crosshair"] == true then
  714.                                 local _, TeamColor = GetTeam(LocalPlayer())
  715.                                 if SmegHack.Options["ESP_Crosshair_Mode"] == "Team" && Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"]) != TeamColor then
  716.                                     SmegHack.Options["ESP_Crosshair_Color_R"] = TeamColor.r
  717.                                     SmegHack.Options["ESP_Crosshair_Color_G"] = TeamColor.g
  718.                                     SmegHack.Options["ESP_Crosshair_Color_B"] = TeamColor.b
  719.                                 end
  720.                                 surface.SetDrawColor(Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"], SmegHack.Options["ESP_Crosshair_Color_A"]))
  721.                                 surface.DrawLine((ScrW()/2)-SmegHack.Options["ESP_Crosshair_Size"], ScrH()/2, (ScrW()/2)+SmegHack.Options["ESP_Crosshair_Size"], ScrH()/2)
  722.                                 surface.DrawLine(ScrW()/2, (ScrH()/2)-SmegHack.Options["ESP_Crosshair_Size"], ScrW()/2, (ScrH()/2)+SmegHack.Options["ESP_Crosshair_Size"])
  723.                             end
  724.                             if Ent:IsNPC() || Ent:IsPlayer() then
  725.                                 local Name
  726.                                 local ShowTeam, ShowOpponents, ShowFriends, ShowEnemies, ShowNPCs, ShowSpectators = false, false, false, false, false, false
  727.                                 local ShowTeamV, ShowOpponentsV, ShowFriendsV, ShowEnemiesV, ShowNPCsV, ShowSpectatorsV = true, true, true, true, true, true
  728.  
  729.                                 if !Ent:IsNPC() && Ent:Health() > 0 then
  730.                                     local Team, _ = GetTeam(Ent)
  731.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowTeam"] && Team == GetTeam(LocalPlayer()) then
  732.                                         if SmegHack.Options["ESP_ShowTeamV"] == "Show" then
  733.                                             ShowTeam = true
  734.                                         else
  735.                                             ShowTeamV = false
  736.                                         end
  737.                                     end
  738.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowOpponents"] && Team != GetTeam(LocalPlayer()) then
  739.                                         if SmegHack.Options["ESP_ShowOpponentsV"] == "Show" then
  740.                                             ShowOpponents = true
  741.                                         else
  742.                                             ShowOpponentsV = false
  743.                                         end
  744.                                     end
  745.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowFriends"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  746.                                         if SmegHack.Options["ESP_ShowFriendsV"] == "Show" then
  747.                                             ShowFriends = true
  748.                                         else
  749.                                             ShowFriendsV = false
  750.                                         end
  751.                                     end
  752.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowEnemies"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  753.                                         if SmegHack.Options["ESP_ShowEnemiesV"] =="Show" then
  754.                                             ShowEnemies = true
  755.                                         else
  756.                                             ShowEnemiesV = false
  757.                                         end
  758.                                     end
  759.                                     if SmegHack.Options["ESP_ShowSpectators"] && Ent:Team() == TEAM_SPECTATOR then
  760.                                         if SmegHack.Options["ESP_ShowSpectatorsV"] == "Show" then
  761.                                             ShowSpectators = true
  762.                                         else
  763.                                             ShowSpectatorsV = false
  764.                                         end
  765.                                     end
  766.                                     Name = Ent:Nick()
  767.                                 else
  768.                                     if SmegHack.Options["ESP_ShowNPCs"] && Ent:IsNPC() then
  769.                                         if SmegHack.Options["ESP_ShowNPCsV"] == "Show" then
  770.                                             ShowNPCs = true
  771.                                         else
  772.                                             ShowNPCsV = false
  773.                                         end
  774.                                     end
  775.                                     Name = Ent:GetClass()
  776.                                 end
  777.                                 if (ShowTeam || ShowOpponents || ShowFriends || ShowEnemies || ShowNPCs || ShowSpectators) && (ShowTeamV && ShowOpponentsV && ShowFriendsV && ShowEnemiesV && ShowNPCsV && ShowSpectatorsV) then
  778.                                     local MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8 = ESPGetPos( Ent )
  779.                                     local DrawColor
  780.                                     local ESPPos = MinY
  781.                                     if Ent:IsNPC() then DrawColor = Color(170,220,120) else _, DrawColor = GetTeam(Ent) end
  782.                                     if SmegHack.Options["ESP_BoundaryBoxes"] then
  783.                                         surface.SetDrawColor( DrawColor )
  784.                                         if SmegHack.Options["ESP_BoundaryBoxes_Mode"] == "2D" then
  785.                                             surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  786.                                             surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  787.                                             surface.DrawLine( MinX, MinY, MaxX, MinY )
  788.                                             surface.DrawLine( MinX, MinY, MinX, MaxY )
  789.                                         else
  790.                                             //Top Box
  791.                                             surface.DrawLine( V4.x, V4.y, V6.x, V6.y )
  792.                                             surface.DrawLine( V1.x, V1.y, V8.x, V8.y )
  793.                                             surface.DrawLine( V6.x, V6.y, V8.x, V8.y )
  794.                                             surface.DrawLine( V4.x, V4.y, V1.x, V1.y )
  795.  
  796.                                             //Bottom Box
  797.                                             surface.DrawLine( V3.x, V3.y, V5.x, V5.y )
  798.                                             surface.DrawLine( V2.x, V2.y, V7.x, V7.y )
  799.                                             surface.DrawLine( V3.x, V3.y, V2.x, V2.y )
  800.                                             surface.DrawLine( V5.x, V5.y, V7.x, V7.y )
  801.  
  802.                                             //Verticals
  803.                                             surface.DrawLine( V3.x, V3.y, V4.x, V4.y )
  804.                                             surface.DrawLine( V2.x, V2.y, V1.x, V1.y )
  805.                                             surface.DrawLine( V7.x, V7.y, V8.x, V8.y )
  806.                                             surface.DrawLine( V5.x, V5.y, V6.x, V6.y )
  807.                                         end
  808.                                     end
  809.                                     if SmegHack.Options["ESP_Health"] then                 
  810.                                         local HealthColor = Color( (1-(Ent:Health()/Ent:GetMaxHealth()))*255, (Ent:Health()/Ent:GetMaxHealth())*255, 0 )
  811.                                         local HealthString = tostring(Ent:Health())
  812.  
  813.                                         if MaxY-MinY <= 45 then
  814.                                             local TopHealthFar = ((1-(Ent:Health()/Ent:GetMaxHealth()))*43)+MinY+1
  815.                                             local BottomHealthFar = 43-((1-(Ent:Health()/Ent:GetMaxHealth()))*43)
  816.                                             draw.RoundedBox( 0, MinX-15, MinY, 10, 45, Color(0,0,0) )
  817.                                             draw.RoundedBox( 0, MinX-14, TopHealthFar, 8, BottomHealthFar, HealthColor )
  818.                                             draw.SimpleTextOutlined( HealthString.."%", "ESP_Font_Entity", MinX-17, MinY+22.5, HealthColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  819.                                         else
  820.                                             local TopHealthClose = (MinY+((1-(Ent:Health()/Ent:GetMaxHealth()))*(MaxY-MinY)))+1
  821.                                             local BottomHealthClose = ((Ent:Health()/Ent:GetMaxHealth())*(MaxY-MinY))-2
  822.                                             draw.RoundedBox( 0, MinX-15, MinY, 10, MaxY-MinY, Color(0,0,0) )
  823.                                             draw.RoundedBox( 0, MinX-14, TopHealthClose, 8, BottomHealthClose, HealthColor )
  824.                                             draw.SimpleTextOutlined( HealthString.."%", "ESP_Font_Entity", MinX-17, ((MinY-MaxY)/2)+MaxY, HealthColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  825.                                         end
  826.  
  827.                                     end
  828.                                     if SmegHack.Options["ESP_NameTags"] then
  829.                                         if GMode == 2 && Ent:GetBystanderName() != nil then
  830.  
  831.                                             draw.SimpleTextOutlined( "N: "..Name.." ("..Ent:GetBystanderName()..")", "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  832.                                         else
  833.                                             draw.SimpleTextOutlined( "N: "..Name, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  834.                                         end
  835.                                         ESPPos = ESPPos + 15
  836.                                     end
  837.                                     if SmegHack.Options["ESP_Weapon"] then
  838.                                         if Ent:GetActiveWeapon():IsValid() then
  839.                                             local WName = Ent:GetActiveWeapon():GetPrintName()
  840.                                             draw.SimpleTextOutlined( "W: "..WName, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  841.                                             ESPPos = ESPPos + 15
  842.                                         end
  843.                                     end
  844.                                     if SmegHack.Options["ESP_Distance"] then
  845.                                         local Dist = math.floor(Ent:GetPos():Distance(LocalPlayer():GetShootPos())/40)
  846.                                         draw.SimpleTextOutlined( "D: "..Dist, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  847.                                         ESPPos = ESPPos + 15
  848.                                     end
  849.                                     if SmegHack.Options["ESP_Skeleton"] then
  850.                                         local Bones = {}
  851.                                         local Success = true
  852.                                         for k, v in pairs(SmegHack.Bones) do
  853.                                             if Ent:LookupBone(v) != nil && Ent:GetBonePosition(Ent:LookupBone(v)) != nil then
  854.                                                 table.insert( Bones, Ent:GetBonePosition(Ent:LookupBone(v)):ToScreen() )
  855.                                             else
  856.                                                 Success = false //Just incase entities have some bones but not others (I have no idea if that happens, but I figgured better safe then sorry)
  857.                                                 return
  858.                                             end
  859.                                         end
  860.                                         if Success then
  861.                                             surface.SetDrawColor( DrawColor )
  862.                                             //Spine
  863.                                             surface.DrawLine( Bones[1].x, Bones[1].y, Bones[2].x, Bones[2].y )
  864.                                             surface.DrawLine( Bones[2].x, Bones[2].y, Bones[3].x, Bones[3].y )
  865.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[4].x, Bones[4].y )
  866.                                             surface.DrawLine( Bones[4].x, Bones[4].y, Bones[5].x, Bones[5].y )
  867.                                             surface.DrawLine( Bones[5].x, Bones[5].y, Bones[6].x, Bones[6].y )
  868.                                             surface.DrawLine( Bones[6].x, Bones[6].y, Bones[7].x, Bones[7].y )
  869.  
  870.                                             //Legs
  871.                                             surface.DrawLine( Bones[7].x, Bones[7].y, Bones[14].x, Bones[14].y )
  872.                                             surface.DrawLine( Bones[14].x, Bones[14].y, Bones[15].x, Bones[15].y )
  873.                                             surface.DrawLine( Bones[15].x, Bones[15].y, Bones[16].x, Bones[16].y )
  874.                                             surface.DrawLine( Bones[16].x, Bones[16].y, Bones[17].x, Bones[17].y )
  875.  
  876.                                             surface.DrawLine( Bones[7].x, Bones[7].y, Bones[18].x, Bones[18].y )
  877.                                             surface.DrawLine( Bones[18].x, Bones[18].y, Bones[19].x, Bones[19].y )
  878.                                             surface.DrawLine( Bones[19].x, Bones[19].y, Bones[20].x, Bones[20].y )
  879.                                             surface.DrawLine( Bones[20].x, Bones[20].y, Bones[21].x, Bones[21].y )
  880.  
  881.                                             //Arms
  882.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[8].x, Bones[8].y )
  883.                                             surface.DrawLine( Bones[8].x, Bones[8].y, Bones[9].x, Bones[9].y )
  884.                                             surface.DrawLine( Bones[9].x, Bones[9].y, Bones[10].x, Bones[10].y )
  885.  
  886.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[11].x, Bones[11].y )
  887.                                             surface.DrawLine( Bones[11].x, Bones[11].y, Bones[12].x, Bones[12].y )
  888.                                             surface.DrawLine( Bones[12].x, Bones[12].y, Bones[13].x, Bones[13].y )
  889.  
  890.                                         end
  891.                                     end
  892.                                 end
  893.                             end
  894.                         end
  895.                     end
  896.                 end
  897.             end
  898.         end
  899.     end)
  900.  
  901.     AddHook( "BhopCalcView", "CalcView", RandomString(), function( ply, pos, angles, fov )
  902.         if GetConVarNumber("SmegHack_Panic") == 0 && SmegHack.Options["Bhop_Toggle"] then
  903.             if SmegHack.Options["Bhop_Sideways"] then
  904.                 local CamData = {}
  905.                 if TapS then CamData.angles = LocalPlayer():EyeAngles()+Angle(0,180,0) else CamData.angles = LocalPlayer():EyeAngles()+Angle(0,90,0) end
  906.                 CamData.origin = LocalPlayer():GetShootPos()
  907.                 CamData.fov = fov
  908.  
  909.                 return CamData
  910.             elseif SmegHack.Options["Bhop_WOnly"] then
  911.                 local CamData = {}
  912.                 if WLeft then
  913.                     CamData.angles = LocalPlayer():EyeAngles()-Angle(0,90,0)
  914.                 elseif WRight then
  915.                     CamData.angles = LocalPlayer():EyeAngles()+Angle(0,90,0)
  916.                 elseif WBack then
  917.                     CamData.angles = LocalPlayer():EyeAngles()+Angle(0,180,0)
  918.                 end
  919.                 CamData.origin = LocalPlayer():GetShootPos()
  920.                 CamData.fov = fov
  921.  
  922.                 return CamData
  923.             end
  924.         end
  925.     end)
  926.     AddHook( "Bhop", "CreateMove", RandomString(), function(ucmd)
  927.         if SmegHack.Options["Bhop_Toggle"] && GetConVarNumber("SmegHack_Panic") == 0 then
  928.             if SmegHack.Options["Bhop_FastWalk"] then
  929.                 if LocalPlayer():IsOnGround() && ( ucmd:KeyDown(IN_FORWARD) || ucmd:KeyDown(IN_BACK) ) then
  930.                     if FastWalk == false then
  931.                         ucmd:SetSideMove(ucmd:GetSideMove()-5000)
  932.                     else
  933.                         ucmd:SetSideMove(ucmd:GetSideMove()+5000)
  934.                     end
  935.                     FastWalk = !FastWalk
  936.                 end
  937.             end
  938.             if SmegHack.Options["Bhop_AutoHop"] then
  939.                 if ucmd:KeyDown(IN_JUMP) then
  940.                     if LocalPlayer():WaterLevel() <= 1 && LocalPlayer():GetMoveType() != MOVETYPE_LADDER && !LocalPlayer():IsOnGround() then
  941.                         ucmd:RemoveKey(IN_JUMP)
  942.                     end
  943.                 end
  944.             end
  945.             if SmegHack.Options["Bhop_AutoStrafe"] && !LocalPlayer():IsOnGround() && LocalPlayer():WaterLevel() <= 1 && LocalPlayer():GetMoveType() != MOVETYPE_LADDER && !( LocalPlayer():KeyDown(IN_FORWARD) || LocalPlayer():KeyDown(IN_BACK) || LocalPlayer():KeyDown(IN_MOVELEFT) || LocalPlayer():KeyDown(IN_MOVERIGHT) ) then
  946.                 if SmegHack.Options["Bhop_Sideways"] && !TapS then
  947.                     if ucmd:GetMouseX() < 0 then
  948.                         ucmd:SetForwardMove(-1000000)
  949.                     end
  950.                     if ucmd:GetMouseX() > 0 then
  951.                         ucmd:SetForwardMove(1000000)
  952.                     end
  953.                 elseif SmegHack.Options["Bhop_WOnly"] then
  954.                     if ucmd:GetMouseX() < 0 then
  955.                         ucmd:SetForwardMove(1000000)
  956.                         if !WLeft then
  957.                             if WRight then
  958.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  959.                             elseif WForward then
  960.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  961.                             elseif WBack then
  962.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  963.                             end
  964.                             WLeft = true
  965.                             WRight, WForward, WBack = false, false, false
  966.                         end
  967.                     elseif ucmd:GetMouseX() > 0 then
  968.                         ucmd:SetForwardMove(1000000)
  969.                         if !WRight then
  970.                             if WLeft then
  971.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  972.                             elseif WForward then
  973.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  974.                             elseif WBack then
  975.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  976.                             end
  977.                             WRight = true
  978.                             WLeft, WForward, WBack = false, false, false
  979.                         end
  980.                     end
  981.                 else
  982.                     if ucmd:GetMouseX() < 0 then
  983.                         ucmd:SetSideMove(-1000000)
  984.                     end
  985.                     if ucmd:GetMouseX() > 0 then
  986.                         ucmd:SetSideMove(1000000)
  987.                     end
  988.                 end
  989.             end
  990.             if SmegHack.Options["Bhop_EdgeJump"] then
  991.                 if LocalPlayer():IsOnGround() then
  992.                     local WalkAngle
  993.                     if LocalPlayer():GetVelocity():Length() != 0 then
  994.                         WalkAngle = Angle( 0, LocalPlayer():GetVelocity():Angle().y, 0 )
  995.                     else
  996.                         WalkAngle = Angle( 0, LocalPlayer():EyeAngles().y, 0 )
  997.                     end
  998.                     local FinPos = LocalPlayer():EyePos() + (WalkAngle:Forward()*(SmegHack.Options["Bhop_EdgeJump_Distance"]-50))
  999.                     FinPos.z = LocalPlayer():GetPos().z-5
  1000.                     local GroundDetect = {
  1001.                             start = LocalPlayer():GetShootPos(),
  1002.                             endpos = FinPos,
  1003.                             filter = LocalPlayer(),
  1004.                             mask = MASK_PLAYERSOLID
  1005.                         }
  1006.                     if util.TraceLine(GroundDetect).Fraction == 1 then
  1007.                         ucmd:SetButtons( ucmd:GetButtons() + IN_JUMP )
  1008.                     end
  1009.                 end
  1010.                 //LocalPlayer():SetEyeAngles(Angle( 0,LocalPlayer():GetVelocity():Angle().y,LocalPlayer():GetVelocity():Angle().z )) <-Just for safe keeping
  1011.             end
  1012.             if SmegHack.Options["Bhop_Sideways"] then
  1013.                 if ucmd:KeyDown(IN_MOVELEFT) && !TapS then
  1014.                     if ucmd:KeyDown(IN_MOVERIGHT) then ForwardMove = 0 elseif ForwardMove == 0 then ForwardMove = -1000000 end
  1015.                     ucmd:SetSideMove(SideMove)
  1016.                     ucmd:SetForwardMove(ForwardMove)
  1017.                 end
  1018.                 if ucmd:KeyDown(IN_MOVERIGHT) && !TapS then
  1019.                     if ucmd:KeyDown(IN_MOVELEFT) then ForwardMove = 0 elseif ForwardMove == 0 then ForwardMove = 1000000 end
  1020.                     ucmd:SetSideMove(SideMove)
  1021.                     ucmd:SetForwardMove(ForwardMove)
  1022.                 end
  1023.                 if !ucmd:KeyDown(IN_MOVELEFT) && !ucmd:KeyDown(IN_MOVERIGHT) && !TapS then ForwardMove = 0 end
  1024.  
  1025.                 if ucmd:KeyDown(IN_FORWARD) && !TapS then
  1026.                     if ucmd:KeyDown(IN_BACK) then SideMove = 0 elseif SideMove == 0 then SideMove = -1000000 end
  1027.                     ucmd:SetSideMove(SideMove)
  1028.                     ucmd:SetForwardMove(ForwardMove)
  1029.                 end
  1030.                 if ucmd:KeyDown(IN_BACK) && LocalPlayer():IsOnGround() && !TapS then
  1031.                     if ucmd:KeyDown(IN_FORWARD) then SideMove = 0 elseif SideMove == 0 then SideMove = 1000000 end
  1032.                     ucmd:SetSideMove(SideMove)
  1033.                     ucmd:SetForwardMove(ForwardMove)
  1034.                 elseif ucmd:KeyDown(IN_BACK) && !LocalPlayer():IsOnGround() && !TapS then
  1035.                     ForwardMove = 1000000
  1036.                     ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1037.                     ucmd:SetForwardMove(ForwardMove)
  1038.                     TapS = true
  1039.                 end
  1040.                 if !ucmd:KeyDown(IN_FORWARD) && !ucmd:KeyDown(IN_BACK) && !TapS then SideMove = 0 end
  1041.                 if !LocalPlayer():IsOnGround() && ucmd:KeyDown(IN_BACK) && TapS then
  1042.                     ucmd:SetForwardMove(1000000)
  1043.                 elseif ( !ucmd:KeyDown(IN_BACK) || LocalPlayer():IsOnGround() ) && TapS then
  1044.                     ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1045.                     TapS = false
  1046.                 end
  1047.             elseif SmegHack.Options["Bhop_WOnly"] then
  1048.                 if ucmd:KeyDown(IN_MOVELEFT) && !WLeft then
  1049.                     if WRight then
  1050.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1051.                     elseif WForward then
  1052.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1053.                     elseif WBack then
  1054.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1055.                     end
  1056.                     WLeft = true
  1057.                     WRight, WForward, WBack = false, false, false
  1058.                 elseif ucmd:KeyDown(IN_MOVERIGHT) && !WRight then
  1059.                     if WLeft then
  1060.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1061.                     elseif WForward then
  1062.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1063.                     elseif WBack then
  1064.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1065.                     end
  1066.                     WRight = true
  1067.                     WLeft, WForward, WBack = false, false, false
  1068.                 elseif ucmd:KeyDown(IN_FORWARD) && !WForward then
  1069.                     if WRight then
  1070.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1071.                     elseif WLeft then
  1072.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1073.                     elseif WBack then
  1074.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1075.                     end
  1076.                     WForward = true
  1077.                     WLeft, WRight, WBack = false, false, false
  1078.                 elseif ucmd:KeyDown(IN_BACK) && !WBack then
  1079.                     if WRight then
  1080.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1081.                     elseif WForward then
  1082.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1083.                     elseif WLeft then
  1084.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1085.                     end
  1086.                     WBack = true
  1087.                     WLeft, WRight, WForward = false, false, false
  1088.                 end
  1089.                 if !ucmd:KeyDown(IN_MOVELEFT) && !ucmd:KeyDown(IN_MOVERIGHT) && !ucmd:KeyDown(IN_FORWARD) && !ucmd:KeyDown(IN_BACK) then WActive = false else WActive = true end
  1090.                 if WActive then
  1091.                     ucmd:SetForwardMove(1000000)
  1092.                     ucmd:SetSideMove(0)
  1093.                 end
  1094.             end
  1095.         end
  1096.     end)
  1097.  
  1098.     AddHook( "Cams", "CalcView", RandomString(), function( ply, Pos, Ang, FOV )
  1099.         if SmegHack.Options["Cams_Toggle"] && GetConVarNumber("SmegHack_Panic") == 0 then
  1100.             local CamData = {}
  1101.             if SmegHack.Options["Cams_CSNoclip"] then
  1102.                 local Speed = SmegHack.Options["Cams_CSNoclip_Speed"]/5
  1103.                 local MouseAngs = Angle( NoclipY, NoclipX, 0 )
  1104.                 if LocalPlayer():KeyDown(IN_SPEED) then
  1105.                     Speed = Speed * 5
  1106.                 end
  1107.                 if LocalPlayer():KeyDown(IN_FORWARD) then
  1108.                     NoclipPos = NoclipPos+(MouseAngs:Forward()*Speed)
  1109.                 end
  1110.                 if LocalPlayer():KeyDown(IN_BACK) then
  1111.                     NoclipPos = NoclipPos-(MouseAngs:Forward()*Speed)
  1112.                 end
  1113.                 if LocalPlayer():KeyDown(IN_MOVELEFT) then
  1114.                     NoclipPos = NoclipPos-(MouseAngs:Right()*Speed)
  1115.                 end
  1116.                 if LocalPlayer():KeyDown(IN_MOVERIGHT) then
  1117.                     NoclipPos = NoclipPos+(MouseAngs:Right()*Speed)
  1118.                 end
  1119.                 if NoclipJump then
  1120.                     NoclipPos = NoclipPos+Vector(0,0,Speed)
  1121.                 end
  1122.                 if NoclipDuck then
  1123.                     NoclipPos = NoclipPos-Vector(0,0,Speed)
  1124.                 end
  1125.                 CamData.origin = NoclipPos
  1126.                 CamData.angles = MouseAngs
  1127.                 CamData.fov = FOV
  1128.                 CamData.drawviewer = true
  1129.             elseif SmegHack.Options["Cams_ThirdPerson"] then
  1130.                 CamData.origin = Pos-(Ang:Forward()*(SmegHack.Options["Cams_ThirdPerson_Zoom"]*10))
  1131.                 CamData.angles = Ang
  1132.                 CamData.fov = FOV
  1133.                 CamData.drawviewer = true
  1134.             end
  1135.             return CamData
  1136.         end
  1137.     end)
  1138.     AddHook( "Bhop", "CreateMove", RandomString(), function(ucmd)
  1139.         if SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"] && GetConVarNumber("SmegHack_Panic") == 0 then
  1140.             if NoclipOn == false then
  1141.                 NoclipPos, NoclipAngles = LocalPlayer():EyePos(), ucmd:GetViewAngles()
  1142.                 NoclipY, NoclipX = ucmd:GetViewAngles().x, ucmd:GetViewAngles().y
  1143.                 NoclipOn = true
  1144.             end
  1145.             ucmd:ClearMovement()
  1146.             if ucmd:KeyDown(IN_JUMP) then
  1147.                 ucmd:RemoveKey(IN_JUMP)
  1148.                 NoclipJump = true
  1149.             elseif NoclipJump then
  1150.                 NoclipJump = false
  1151.             end
  1152.             if ucmd:KeyDown(IN_DUCK) then
  1153.                 ucmd:RemoveKey(IN_DUCK)
  1154.                 NoclipDuck = true
  1155.             elseif NoclipDuck then
  1156.                 NoclipDuck = false
  1157.             end
  1158.             NoclipX = NoclipX-(ucmd:GetMouseX()/50)
  1159.             if NoclipY+(ucmd:GetMouseY()/50) > 89 then NoclipY = 89 elseif NoclipY+(ucmd:GetMouseY()/50) < -89 then NoclipY = -89 else NoclipY = NoclipY+(ucmd:GetMouseY()/50) end
  1160.             ucmd:SetViewAngles(NoclipAngles)
  1161.         elseif NoclipOn == true then
  1162.             NoclipOn = false
  1163.         end
  1164.     end)
  1165.     if Display then
  1166.         AddHook( "Loaded", "HUDPaint", RandomString(), function()
  1167.             draw.SimpleTextOutlined( "Smeg Hack Loaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  1168.             timer.Simple( 3, function()
  1169.                 RemoveHook("Loaded")
  1170.             end)
  1171.         end)
  1172.     end
  1173. end
  1174.  
  1175. //Bones
  1176. SmegHack.Bones = {
  1177. "ValveBiped.Bip01_Head1",
  1178. "ValveBiped.Bip01_Neck1",
  1179. "ValveBiped.Bip01_Spine4",
  1180. "ValveBiped.Bip01_Spine2",
  1181. "ValveBiped.Bip01_Spine1",
  1182. "ValveBiped.Bip01_Spine",
  1183. "ValveBiped.Bip01_Pelvis",
  1184. "ValveBiped.Bip01_R_UpperArm",
  1185. "ValveBiped.Bip01_R_Forearm",
  1186. "ValveBiped.Bip01_R_Hand",
  1187. "ValveBiped.Bip01_L_UpperArm",
  1188. "ValveBiped.Bip01_L_Forearm",
  1189. "ValveBiped.Bip01_L_Hand",
  1190. "ValveBiped.Bip01_R_Thigh",
  1191. "ValveBiped.Bip01_R_Calf",
  1192. "ValveBiped.Bip01_R_Foot",
  1193. "ValveBiped.Bip01_R_Toe0",
  1194. "ValveBiped.Bip01_L_Thigh",
  1195. "ValveBiped.Bip01_L_Calf",
  1196. "ValveBiped.Bip01_L_Foot",
  1197. "ValveBiped.Bip01_L_Toe0"
  1198. }
  1199.  
  1200. //Key Binds
  1201. SmegHack.KeyBinds = {
  1202. [0] = "NONE",
  1203. [1] = "0",
  1204. [2] = "1",
  1205. [3] = "2",
  1206. [4] = "3",
  1207. [5] = "4",
  1208. [6] = "5",
  1209. [7] = "6",
  1210. [8] = "7",
  1211. [9] = "8",
  1212. [10] = "9",
  1213. [11] = "A",
  1214. [12] = "B",
  1215. [13] = "C",
  1216. [14] = "D",
  1217. [15] = "E",
  1218. [16] = "F",
  1219. [17] = "G",
  1220. [18] = "H",
  1221. [19] = "I",
  1222. [20] = "J",
  1223. [21] = "K",
  1224. [22] = "L",
  1225. [23] = "M",
  1226. [24] = "N",
  1227. [25] = "O",
  1228. [26] = "P",
  1229. [27] = "Q",
  1230. [28] = "R",
  1231. [29] = "S",
  1232. [30] = "T",
  1233. [31] = "U",
  1234. [32] = "V",
  1235. [33] = "W",
  1236. [34] = "X",
  1237. [35] = "Y",
  1238. [36] = "Z",
  1239. [37] = "PAD_0",
  1240. [38] = "PAD_1",
  1241. [39] = "PAD_2",
  1242. [40] = "PAD_3",
  1243. [41] = "PAD_4",
  1244. [42] = "PAD_5",
  1245. [43] = "PAD_6",
  1246. [44] = "PAD_7",
  1247. [45] = "PAD_8",
  1248. [46] = "PAD_9",
  1249. [47] = "PAD_DIVIDE",
  1250. [48] = "PAD_MULTIPLY",
  1251. [49] = "PAD_MINUS",
  1252. [50] = "PAD_PLUS",
  1253. [51] = "PAD_ENTER",
  1254. [52] = "PAD_DECIMAL",
  1255. [53] = "LBRACKET",
  1256. [54] = "RBRACKET",
  1257. [55] = "SEMICOLON",
  1258. [56] = "APOSTROPHE",
  1259. [57] = "BACKQUOTE",
  1260. [58] = "COMMA",
  1261. [59] = "PERIOD",
  1262. [60] = "SLASH",
  1263. [61] = "BACKSLASH",
  1264. [62] = "MINUS",
  1265. [63] = "EQUAL",
  1266. [64] = "ENTER",
  1267. [65] = "SPACE",
  1268. [66] = "BACKSPACE",
  1269. [67] = "TAB",
  1270. [68] = "CAPSLOCK",
  1271. [69] = "NUMLOCK",
  1272. [70] = "ESCAPE",
  1273. [71] = "SCROLLLOCK",
  1274. [72] = "INSERT",
  1275. [73] = "DELETE",
  1276. [74] = "HOME",
  1277. [75] = "END",
  1278. [76] = "PAGEUP",
  1279. [77] = "PAGEDOWN",
  1280. [78] = "BREAK",
  1281. [79] = "LSHIFT",
  1282. [80] = "RSHIFT",
  1283. [81] = "LALT",
  1284. [82] = "RALT",
  1285. [83] = "LCONTROL",
  1286. [84] = "RCONTROL",
  1287. [85] = "LWIN",
  1288. [86] = "RWIN",
  1289. [87] = "APP",
  1290. [88] = "UP",
  1291. [89] = "LEFT",
  1292. [90] = "DOWN",
  1293. [91] = "RIGHT",
  1294. [92] = "F1",
  1295. [93] = "F2",
  1296. [94] = "F3",
  1297. [95] = "F4",
  1298. [96] = "F5",
  1299. [97] = "F6",
  1300. [98] = "F7",
  1301. [99] = "F8",
  1302. [100] = "F9",
  1303. [101] = "F10",
  1304. [102] = "F11",
  1305. [103] = "F12",
  1306. //[104] = "CAPSLOCKTOGGLE",   These three screw up the binding process, probably wont bother working out how to fix it
  1307. //[105] = "NUMLOCKTOGGLE",
  1308. //[106] = "SCROLLLOCKTOGGLE",
  1309.  
  1310. //Xbox Controller Binds - These are untested as I don't own an xbox controller, so they might not work
  1311. [114] = "XBUTTON_A",
  1312. [115] = "XBUTTON_B",
  1313. [116] = "XBUTTON_X",
  1314. [117] = "XBUTTON_Y",
  1315. [118] = "XBUTTON_LEFT_SHOULDER",
  1316. [119] = "XBUTTON_RIGHT_SHOULDER",
  1317. [120] = "XBUTTON_BACK",
  1318. [121] = "XBUTTON_START",
  1319. [122] = "XBUTTON_STICK1",
  1320. [123] = "XBUTTON_STICK2",
  1321. [146] = "XBUTTON_UP",
  1322. [147] = "XBUTTON_RIGHT",
  1323. [148] = "XBUTTON_DOWN",
  1324. [149] = "XBUTTON_LEFT",
  1325. [150] = "XSTICK1_RIGHT",
  1326. [151] = "XSTICK1_LEFT",
  1327. [152] = "XSTICK1_DOWN",
  1328. [153] = "XSTICK1_UP",
  1329. [154] = "XBUTTON_LTRIGGER",
  1330. [155] = "XBUTTON_RTRIGGER",
  1331. [156] = "XSTICK2_RIGHT",
  1332. [157] = "XSTICK2_LEFT",
  1333. [158] = "XSTICK2_DOWN",
  1334. [159] = "XSTICK2_UP"
  1335. }
  1336.  
  1337. //Mouse Binds (Needs to be separate otherwise it doesn't work)
  1338. SmegHack.MouseBinds = {
  1339. [107] = "MOUSE_LEFT",
  1340. [108] = "MOUSE_RIGHT",
  1341. [109] = "MOUSE_MIDDLE",
  1342. [110] = "MOUSE_4",
  1343. [111] = "MOUSE_5",
  1344. [112] = "MOUSE_WHEEL_UP",
  1345. [113] = "MOUSE_WHEEL_DOWN"
  1346. }
  1347.  
  1348. //Aimbot
  1349. function Aimbot( FinAngle )
  1350.     if SmegHack.Options["Aimbot_SmoothAim"] then
  1351.         SmoothAngles( FinAngle, SmegHack.Options["Aimbot_SmoothAim_Value"] )
  1352.     else
  1353.         LocalPlayer():SetEyeAngles(FinAngle)
  1354.     end
  1355. end
  1356.  
  1357. function SmoothAngles( FinAngle, SmoothValue )
  1358.     local SmoothValue = 10-(10*(SmoothValue/1000))
  1359.     local CloseToAngle = false
  1360.     local SmoothDirectionX = 1
  1361.     local SmoothDirectionY = 1
  1362.     local CurAngle = LocalPlayer():EyeAngles()
  1363.     if FinAngle.x > 89 then FinAngle.x = FinAngle.x - 360 end
  1364.     if CurAngle == FinAngle then
  1365.         SmoothDirectionX = 1
  1366.     elseif CurAngle.y < 0 && FinAngle.y < 0 then
  1367.         CloseToAngle = true
  1368.         if CurAngle.y > FinAngle.y then
  1369.             SmoothDirectionX = 2
  1370.         elseif CurAngle.y < FinAngle.y then
  1371.             SmoothDirectionX = 3
  1372.         end
  1373.     elseif CurAngle.y >= 0 && FinAngle.y >= 0 then
  1374.         CloseToAngle = true
  1375.         if CurAngle.y > FinAngle.y then
  1376.             SmoothDirectionX = 2
  1377.         elseif CurAngle.y < FinAngle.y then
  1378.             SmoothDirectionX = 3
  1379.         end
  1380.     elseif CurAngle.y >= 0 && FinAngle.y < 0 then
  1381.         local FlipAngle = CurAngle-(Angle(0,180,0))
  1382.         if FlipAngle.y > FinAngle.y then
  1383.             SmoothDirectionX = 3
  1384.         elseif FlipAngle.y < FinAngle.y then
  1385.             SmoothDirectionX = 2
  1386.         end
  1387.     elseif CurAngle.y < 0 && FinAngle.y >= 0 then
  1388.         local FlipAngle = CurAngle+(Angle(0,180,0))
  1389.         if FlipAngle.y < FinAngle.y then
  1390.             SmoothDirectionX = 2   
  1391.         elseif FlipAngle.y > FinAngle.y then
  1392.             SmoothDirectionX = 3
  1393.         end
  1394.     end
  1395.     if FinAngle.x < CurAngle.x then
  1396.         SmoothDirectionY = 2
  1397.     elseif FinAngle.x > CurAngle.x then
  1398.         SmoothDirectionY = 3
  1399.     end
  1400.     local X, Y = false, false
  1401.     if SmoothDirectionX == 2 then
  1402.         if CurAngle.y-SmoothValue < FinAngle.y && CloseToAngle then
  1403.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,FinAngle.y,CurAngle.z))
  1404.             Y = true
  1405.         else
  1406.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,CurAngle.y-SmoothValue,CurAngle.z))
  1407.         end
  1408.     elseif SmoothDirectionX == 3 then
  1409.         if CurAngle.y+SmoothValue > FinAngle.y && CloseToAngle then
  1410.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,FinAngle.y,CurAngle.z))
  1411.             Y = true
  1412.         else
  1413.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,CurAngle.y+SmoothValue,CurAngle.z))
  1414.         end
  1415.     end
  1416.     if SmoothDirectionY == 2 then
  1417.         //up
  1418.         if CurAngle.x-SmoothValue < FinAngle.x then
  1419.             LocalPlayer():SetEyeAngles(Angle(FinAngle.x,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1420.             X = true
  1421.         else
  1422.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x-SmoothValue,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1423.         end
  1424.     elseif SmoothDirectionY == 3 then
  1425.         //down
  1426.         if CurAngle.x+SmoothValue > FinAngle.x then
  1427.             LocalPlayer():SetEyeAngles(Angle(FinAngle.x,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1428.             X = true
  1429.         else
  1430.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x+SmoothValue,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1431.         end
  1432.     end
  1433.     if SmegHack.Options["Aimbot_AutoShoot"] && X && Y then
  1434.         LocalPlayer():ConCommand("+attack")
  1435.         timer.Simple( 0.1, function() LocalPlayer():ConCommand("-attack") end )
  1436.     end
  1437. end
  1438.  
  1439. //ESP Functions
  1440. function ESPGetPos( Ent )
  1441.     if Ent:IsValid() then
  1442.         local Points = {
  1443.             Vector( Ent:OBBMaxs().x, Ent:OBBMaxs().y, Ent:OBBMaxs().z ),
  1444.             Vector( Ent:OBBMaxs().x, Ent:OBBMaxs().y, Ent:OBBMins().z ),
  1445.             Vector( Ent:OBBMaxs().x, Ent:OBBMins().y, Ent:OBBMins().z ),
  1446.             Vector( Ent:OBBMaxs().x, Ent:OBBMins().y, Ent:OBBMaxs().z ),
  1447.             Vector( Ent:OBBMins().x, Ent:OBBMins().y, Ent:OBBMins().z ),
  1448.             Vector( Ent:OBBMins().x, Ent:OBBMins().y, Ent:OBBMaxs().z ),
  1449.             Vector( Ent:OBBMins().x, Ent:OBBMaxs().y, Ent:OBBMins().z ),
  1450.             Vector( Ent:OBBMins().x, Ent:OBBMaxs().y, Ent:OBBMaxs().z )
  1451.         }
  1452.         local MaxX, MaxY, MinX, MinY
  1453.         local V1, V2, V3, V4, V5, V6, V7, V8
  1454.         for k, v in pairs( Points ) do
  1455.             local ScreenPos = Ent:LocalToWorld( v ):ToScreen()
  1456.             if MaxX != nil then
  1457.                 MaxX, MaxY, MinX, MinY = math.max( MaxX, ScreenPos.x ), math.max( MaxY, ScreenPos.y), math.min( MinX, ScreenPos.x ), math.min( MinY, ScreenPos.y)
  1458.             else
  1459.                 MaxX, MaxY, MinX, MinY = ScreenPos.x, ScreenPos.y, ScreenPos.x, ScreenPos.y
  1460.             end
  1461.  
  1462.             if V1 == nil then
  1463.                 V1 = ScreenPos
  1464.             elseif V2 == nil then
  1465.                 V2 = ScreenPos
  1466.             elseif V3 == nil then
  1467.                 V3 = ScreenPos
  1468.             elseif V4 == nil then
  1469.                 V4 = ScreenPos
  1470.             elseif V5 == nil then
  1471.                 V5 = ScreenPos
  1472.             elseif V6 == nil then
  1473.                 V6 = ScreenPos
  1474.             elseif V7 == nil then
  1475.                 V7 = ScreenPos
  1476.             elseif V8 == nil then
  1477.                 V8 = ScreenPos
  1478.             end
  1479.         end
  1480.         return MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8
  1481.     end
  1482. end
  1483.  
  1484. //Menu Items
  1485. function AddMenuTab( Parent, Text, Tab, PosX, PosY, TabID )
  1486.     local AddMenuTab = vgui.Create( "DButton", Parent )
  1487.     AddMenuTab:SetText( Text )
  1488.     AddMenuTab:SetTextColor( Color(255,255,255) )
  1489.     AddMenuTab:SetPos( PosX, PosY )
  1490.     function AddMenuTab:Paint() end
  1491.     AddMenuTab.DoClick = function()
  1492.         ChangeTab( Tab, TabID )
  1493.     end
  1494.     if TabID == 12 then
  1495.         AddMenuTab:SetSize( 48, 30 )
  1496.     else
  1497.         AddMenuTab:SetSize( 49, 30 )
  1498.     end
  1499. end
  1500.  
  1501. function AddLabel( Parent, Text, PosX, PosY, CloseOn )
  1502.     local AddLabel = vgui.Create("DLabel", Parent)
  1503.     AddLabel:SetText( Text )
  1504.     AddLabel:SetPos( PosX, PosY )
  1505.     AddLabel:SetColor(Color(255,255,255,255))
  1506.     AddLabel:SizeToContents()
  1507.     if CloseOn != nil then
  1508.         AddLabel.Think = function()
  1509.             if CloseOn == "Admins" then
  1510.                 if AdminsListBool then
  1511.                     AddLabel:Remove()
  1512.                 end
  1513.             elseif CloseOn == "Spectators" then
  1514.                 if SpecsListBool then
  1515.                     AddLabel:Remove()
  1516.                 end
  1517.             end
  1518.         end
  1519.     end
  1520.     return AddLabel:GetSize()
  1521. end
  1522.  
  1523. function AddMainMenuButton( Parent, Text, PosX, PosY, DoClick )
  1524.     local AddMainMenuButton = vgui.Create( "DButton", Parent )
  1525.     AddMainMenuButton:SetText( Text )
  1526.     AddMainMenuButton:SetTextColor( Color(255,255,255) )
  1527.     AddMainMenuButton:SetSize( 100, 30 )
  1528.     AddMainMenuButton:SetPos( PosX, PosY )
  1529.     function AddMainMenuButton:Paint( w, h )
  1530.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1531.        
  1532.         surface.SetDrawColor( Color(0,0,0,255) )
  1533.         surface.DrawOutlinedRect( 0, 0, w, h )
  1534.     end
  1535.     AddMainMenuButton.DoClick = DoClick
  1536. end
  1537.  
  1538. function AddGenericButton( Parent, Text, SizeX, SizeY, PosX, PosY, DoClick )
  1539.     local AddGenericButton = vgui.Create( "DButton", Parent )
  1540.     AddGenericButton:SetText( Text )
  1541.     AddGenericButton:SetTextColor( Color(255,255,255) )
  1542.     AddGenericButton:SetSize( SizeX, SizeY )
  1543.     AddGenericButton:SetPos( PosX, PosY )
  1544.     function AddGenericButton:Paint( w, h )
  1545.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1546.        
  1547.         surface.SetDrawColor( Color(0,0,0,255) )
  1548.         surface.DrawOutlinedRect( 0, 0, w, h )
  1549.     end
  1550.     AddGenericButton.DoClick = DoClick
  1551. end
  1552.  
  1553. function AddKeyBind( Parent, PosX, PosY, Var )
  1554.     local KeyBind = vgui.Create( "DButton", Parent )
  1555.     if SmegHack.Options["Aimbot_AimOnKey_Key"] >= 107 && SmegHack.Options["Aimbot_AimOnKey_Key"] <= 113 then
  1556.         KeyBind:SetText( SmegHack.MouseBinds[SmegHack.Options["Aimbot_AimOnKey_Key"]])
  1557.     else
  1558.         KeyBind:SetText( SmegHack.KeyBinds[SmegHack.Options["Aimbot_AimOnKey_Key"]])
  1559.     end
  1560.     KeyBind:SetTextColor( Color(255,255,255,255) )
  1561.     KeyBind:SetSize( 100, 15 )
  1562.     KeyBind:SetPos( PosX, PosY )
  1563.     KeyBind:SetTooltip( "Click button then press any key to change bind" )
  1564.     KeyBind.Paint = function()
  1565.         draw.RoundedBox( 0, 1, 1, 99, 14, Color(150,150,150,255) )
  1566.         surface.SetDrawColor( Color(0,0,0) )
  1567.         surface.DrawOutlinedRect( 0, 0, 100, 15 )
  1568.     end
  1569.     KeyBind.DoClick = function()
  1570.         KeyBind:SetText("...")
  1571.         local NoClickMenu = vgui.Create( "DFrame" )
  1572.         NoClickMenu:SetTitle("")
  1573.         NoClickMenu:ShowCloseButton(false)
  1574.         NoClickMenu:SetDraggable(false)
  1575.         NoClickMenu:SetSize(ScrW(), ScrH())
  1576.         NoClickMenu:Center()
  1577.         NoClickMenu:MakePopup()
  1578.         function NoClickMenu:Paint( w, h )
  1579.             draw.RoundedBox( 0, 0, 0, w, h, Color(0,0,0,150) )
  1580.             draw.SimpleTextOutlined( "Press Any Key", "Menu_Title", w/2, h/2, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1581.             draw.SimpleTextOutlined( "Press ESC to cancel", "Menu_Title", w/2, h/2+30, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1582.             draw.SimpleTextOutlined( "Hold ESC to clear bind", "Menu_Title", w/2, h/2+60, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1583.         end
  1584.         local ESCStuff, ESCNum = false, 0
  1585.         KeyBind.Think = function()
  1586.             if !ESCStuff then
  1587.                 for i = 107, 113 do
  1588.                     if input.IsMouseDown(i) then
  1589.                         SmegHack.Options[Var] = i
  1590.                         KeyBind:SetText(SmegHack.MouseBinds[i])
  1591.                         NoClickMenu:Close()
  1592.                         KeyBind.Think = nil
  1593.                     end
  1594.                 end
  1595.                 for i = 0, 159 do
  1596.                     if input.IsKeyDown(i) then
  1597.                         if i == 70 then
  1598.                             LocalPlayer():ConCommand("cancelselect")
  1599.                             ESCStuff = true
  1600.                         else
  1601.                             SmegHack.Options[Var] = i
  1602.                             KeyBind:SetText(SmegHack.KeyBinds[i])
  1603.                             NoClickMenu:Close()
  1604.                             KeyBind.Think = nil
  1605.                         end
  1606.                     end
  1607.                 end
  1608.             else
  1609.                 if input.IsKeyDown(70) then
  1610.                     if ESCNum >= 200 then
  1611.                         SmegHack.Options[Var] = 0
  1612.                         KeyBind:SetText(SmegHack.KeyBinds[0])
  1613.                         NoClickMenu:Close()
  1614.                         KeyBind.Think = nil
  1615.                     else ESCNum = ESCNum + 1 end
  1616.                 else
  1617.                     KeyBind:SetText(SmegHack.KeyBinds[SmegHack.Options[Var]])
  1618.                     NoClickMenu:Close()
  1619.                     KeyBind.Think = nil
  1620.                 end
  1621.             end
  1622.         end
  1623.     end
  1624. end
  1625.  
  1626. function AddCheckBox( Parent, Text, PosX, PosY, ToolTip, Var, ExtraFunc )
  1627.     local AddCheckBox = vgui.Create( "DCheckBoxLabel", Parent )
  1628.     AddCheckBox:SetText( Text )
  1629.     AddCheckBox:SetPos( PosX, PosY )
  1630.     AddCheckBox:SetTooltip( ToolTip )
  1631.     AddCheckBox:SetTextColor( Color(255,255,255,255) )
  1632.     AddCheckBox:SizeToContents()
  1633.     AddCheckBox:SetChecked( SmegHack.Options[Var] )
  1634.     AddCheckBox.OnChange = function()
  1635.         SmegHack.Options[Var] = AddCheckBox:GetChecked()
  1636.         if ExtraFunc != nil then
  1637.             local IsChecked = AddCheckBox:GetChecked()
  1638.             ExtraFunc()
  1639.         end
  1640.     end
  1641. end
  1642.  
  1643. function AddBoneButton( Parent, PosX, PosY, Bone )
  1644.     local AddBoneButton = vgui.Create( "DButton", Parent )
  1645.     if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1646.         for k, v in pairs(SmegHack.BoneOrder) do
  1647.             if v == Bone then
  1648.                 AddBoneButton:SetText(tostring(k))
  1649.             end
  1650.         end
  1651.     else
  1652.         AddBoneButton:SetText("-")
  1653.     end
  1654.     AddBoneButton:SetTextColor( Color(255,255,255,255) )
  1655.     AddBoneButton:SetSize( 16, 16 )
  1656.     AddBoneButton:SetPos( PosX-8, PosY-8 )
  1657.     AddBoneButton:SetTooltip( "Select bones in the order you want to aim at them" )
  1658.     function AddBoneButton:Paint( w, h )
  1659.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1660.        
  1661.         surface.SetDrawColor( Color(0,0,0,255) )
  1662.         surface.DrawOutlinedRect( 0, 0, w, h )
  1663.     end
  1664.     AddBoneButton.DoRightClick = function()
  1665.         local BoneNum
  1666.         if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1667.             for k, v in pairs( SmegHack.BoneOrder ) do
  1668.                 if v == Bone then BoneNum = k end
  1669.             end
  1670.         else BoneNum = 0 end
  1671.  
  1672.         if BoneNum == 0 then
  1673.             table.insert( SmegHack.BoneOrder, Bone )
  1674.         elseif BoneNum == 1 then
  1675.             table.remove( SmegHack.BoneOrder, BoneNum )
  1676.         else
  1677.             table.remove( SmegHack.BoneOrder, BoneNum )
  1678.             table.insert( SmegHack.BoneOrder, BoneNum-1, Bone )
  1679.         end
  1680.         UpdateBoneThink = true
  1681.     end
  1682.     AddBoneButton.DoClick = function()
  1683.         local BoneNum
  1684.         if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1685.             for k, v in pairs( SmegHack.BoneOrder ) do
  1686.                 if v == Bone then BoneNum = k end
  1687.             end
  1688.         else BoneNum = 0 end
  1689.  
  1690.         if BoneNum == 0 then
  1691.             table.insert( SmegHack.BoneOrder, 1, Bone )
  1692.         elseif BoneNum == 21 then
  1693.             table.remove( SmegHack.BoneOrder, BoneNum )
  1694.         else
  1695.             if BoneNum != table.Count( SmegHack.BoneOrder ) then
  1696.                 table.remove( SmegHack.BoneOrder, BoneNum )
  1697.                 table.insert( SmegHack.BoneOrder, BoneNum+1, Bone )
  1698.             else
  1699.                 table.remove( SmegHack.BoneOrder, BoneNum )
  1700.             end
  1701.         end
  1702.         UpdateBoneThink = true
  1703.     end
  1704.     AddBoneButton.Think = function()
  1705.         if UpdateBoneThink then
  1706.             if UpdateBoneThinkNum != 21 then
  1707.                 local BoneNum
  1708.                 if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1709.                     for k, v in pairs( SmegHack.BoneOrder ) do
  1710.                         if v == Bone then BoneNum = k end
  1711.                     end
  1712.                 else BoneNum = 0 end
  1713.                 if BoneNum != 0 then
  1714.                     AddBoneButton:SetText(tostring(BoneNum))
  1715.                 else
  1716.                     AddBoneButton:SetText("-")
  1717.                 end
  1718.                 UpdateBoneThinkNum = UpdateBoneThinkNum+1
  1719.             end
  1720.             if UpdateBoneThinkNum == 21 then
  1721.                 UpdateBoneThinkNum = 0
  1722.                 UpdateBoneThink = false
  1723.             end
  1724.         end
  1725.     end
  1726. end
  1727.  
  1728. function AddComboBox( Parent, PosX, PosY, SizeX, SizeY, Var, ChoiceTable, ExtraFunc )
  1729.     local AddComboBox = vgui.Create( "DComboBox", Parent )
  1730.     AddComboBox:SetPos( PosX, PosY )
  1731.     AddComboBox:SetSize( SizeX, SizeY )
  1732.     AddComboBox:SetValue(SmegHack.Options[Var])
  1733.     for k, v in pairs( ChoiceTable ) do
  1734.         AddComboBox:AddChoice(v)
  1735.     end
  1736.     AddComboBox.OnSelect = function(Selected)
  1737.         SmegHack.Options[Var] = Selected:GetValue()
  1738.         if ExtraFunc != nil then
  1739.             ExtraFunc()
  1740.         end
  1741.     end
  1742. end
  1743.  
  1744. function AddSlider( Parent, Var, PosX, PosY, Min, Max, Decimals )
  1745.     local AddSlider = vgui.Create( "Slider", Parent )
  1746.     AddSlider:SetSize( 150, 15 )
  1747.     AddSlider:SetPos( PosX, PosY )
  1748.     AddSlider:SetMin( Min )
  1749.     AddSlider:SetMax( Max )
  1750.     AddSlider:SetDecimals( Decimals )
  1751.     AddSlider:SetValue( SmegHack.Options[Var] )
  1752.     AddSlider.OnValueChanged = function( Panel, Value )
  1753.         SmegHack.Options[Var] = math.Round( Value, Decimals )
  1754.     end
  1755.     AddSlider.Paint = function()
  1756.         draw.RoundedBox( 0, 0, 0, 135, 15, Color(255,255,255,255) )
  1757.         surface.SetDrawColor(Color(0,0,0,255))
  1758.         surface.DrawOutlinedRect( 0, 0, 135, 15 )
  1759.         surface.DrawLine( 105, 0, 105, 15 )
  1760.     end
  1761. end
  1762.  
  1763. function AddTextEntry( Parent, Width, PosX, PosY, DefaultText, Var, Save )
  1764.     local AddTextEntry = vgui.Create("DTextEntry", Parent)
  1765.     AddTextEntry:SetWide(Width)
  1766.     AddTextEntry:SetPos(PosX,PosY)
  1767.     if Save != nil && SmegHack.TextEntries[Var] != nil then
  1768.         AddTextEntry:SetText(SmegHack.TextEntries[Var])
  1769.     else
  1770.         AddTextEntry:SetText(DefaultText)
  1771.     end
  1772.     AddTextEntry.OnGetFocus = function()
  1773.         if AddTextEntry:GetText() == DefaultText then
  1774.             AddTextEntry:SetText("")
  1775.         end
  1776.     end
  1777.     AddTextEntry.OnLoseFocus = function()
  1778.         if AddTextEntry:GetText() == "" then
  1779.             AddTextEntry:SetText(DefaultText)
  1780.             SmegHack.TextEntries[Var] = nil
  1781.         else
  1782.             SmegHack.TextEntries[Var] = AddTextEntry:GetText()
  1783.         end
  1784.     end
  1785. end
  1786.  
  1787. function AddDisplayBox( Title, Mode )
  1788.     local DisplayBox = vgui.Create( "DFrame" )
  1789.     DisplayBox:SetTitle("")
  1790.     DisplayBox:ShowCloseButton(false)
  1791.     DisplayBox:SetDraggable(true)
  1792.     DisplayBox:SetSize( 150, 50 )
  1793.     function DisplayBox:Paint( w, h )
  1794.         draw.RoundedBox( 0, 0, 0, w, 24, Color(0,0,0,255) )
  1795.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,10,20,245) )
  1796.         draw.SimpleText( Title, "Menu_Title", w/2, 13, Color(0,100,200), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  1797.     end
  1798.  
  1799.     if Mode == 1 then
  1800.         DisplayBox:SetPos( SmegHack.Options["Misc_AdminBox_PosX"], SmegHack.Options["Misc_AdminBox_PosY"] )
  1801.         local AdminTable = {"Moo"}
  1802.         local Wait = false
  1803.         AddHook( "AdminDisplayBox", "Think", RandomString(), function()
  1804.             if !SmegHack.Options["Misc_AdminBox"] then
  1805.                 DisplayBox:Close()
  1806.                 RemoveHook("AdminDisplayBox")
  1807.             end
  1808.             local PoX, PoY = DisplayBox:GetPos()
  1809.             if  SmegHack.Options["Misc_AdminBox_PosX"] != PoX ||  SmegHack.Options["Misc_AdminBox_PosY"] != PoY then
  1810.                 SmegHack.Options["Misc_AdminBox_PosX"], SmegHack.Options["Misc_AdminBox_PosY"] = PoX, PoY
  1811.             end
  1812.             local TempAdminTable = {}
  1813.             for k, v in pairs(player.GetAll()) do
  1814.                 if v:IsAdmin() || v:IsSuperAdmin() then
  1815.                     table.insert( TempAdminTable, v:Nick() )
  1816.                 end
  1817.             end
  1818.             if table.concat(TempAdminTable) != table.concat(AdminTable) then
  1819.                 if !AdminsListBool && !Wait then
  1820.                     AdminsListBool = true
  1821.                     timer.Simple( 0.1, function() AdminsListBool = false Wait = true end )
  1822.                 elseif Wait then
  1823.                     AdminTable = table.Copy(TempAdminTable)
  1824.                     local TextWidth, Tall = 140, 30
  1825.                     local OldWidth, OldTall = DisplayBox:GetSize()
  1826.                     if AdminTable[1] != nil then
  1827.                         for k, v in pairs(AdminTable) do
  1828.                             local TempTextWidth = AddLabel( DisplayBox, v, 5, Tall, "Admins" )
  1829.                             if TempTextWidth > TextWidth then TextWidth = TempTextWidth end
  1830.                             Tall = Tall + 15
  1831.                         end
  1832.                         DisplayBox:SetSize( TextWidth + 10, Tall+5 )
  1833.                     else
  1834.                         AddLabel( DisplayBox, "No Admins Online", 5, Tall, "Admins" )
  1835.                         DisplayBox:SetSize( 150, 50 )
  1836.                     end
  1837.                     local DifferenceX, DifferenceY = OldWidth - TextWidth+10, OldTall - Tall+5
  1838.                     local Var = "AdminBox" //This used to be a function but it screwed up, so I just added it to the hook and I couldn't be bothered making it look normal incase you are wondering what the point of this is
  1839.                     if DifferenceX < 0 then
  1840.                         DifferenceX = DifferenceX * -1
  1841.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] - DifferenceX
  1842.                     else
  1843.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] + DifferenceX
  1844.                     end
  1845.                     if DifferenceY < 0 then
  1846.                         DifferenceY = DifferenceY * -1
  1847.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] - DifferenceY
  1848.                     else
  1849.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] + DifferenceY
  1850.                     end
  1851.  
  1852.                     if SmegHack.Options["Misc_"..Var.."_Mode"] == "Auto" then
  1853.                         local PosX, PosY
  1854.                         if SmegHack.Options["Misc_"..Var.."_PosX"] > ScrW()/2 then PosX = RightPos else PosX = SmegHack.Options["Misc_"..Var.."_PosX"] end
  1855.                         if SmegHack.Options["Misc_"..Var.."_PosY"] > ScrH()/2 then PosY = BottomPos else PosY = SmegHack.Options["Misc_"..Var.."_PosY"] end
  1856.                         DisplayBox:SetPos( PosX, PosY )
  1857.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Top Right" then
  1858.                         DisplayBox:SetPos( RightPos, SmegHack.Options["Misc_"..Var.."_PosY"] )
  1859.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Left" then
  1860.                         DisplayBox:SetPos( SmegHack.Options["Misc_"..Var.."_PosX"], BottomPos )
  1861.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Right" then
  1862.                         DisplayBox:SetPos( RightPos, BottomPos )
  1863.                     end
  1864.                     Wait = false
  1865.                 end
  1866.             end
  1867.         end)
  1868.     elseif Mode == 2 then
  1869.         DisplayBox:SetPos( SmegHack.Options["Misc_SpectatorsBox_PosX"], SmegHack.Options["Misc_SpectatorsBox_PosY"] )
  1870.         local SpecsTable = {"Moo"}
  1871.         local Wait = false
  1872.         AddHook( "SpecDisplayBox", "Think", RandomString(), function()
  1873.             if !SmegHack.Options["Misc_SpectatorsBox"] then
  1874.                 DisplayBox:Close()
  1875.                 RemoveHook("SpecDisplayBox")
  1876.             end
  1877.             local PoX, PoY = DisplayBox:GetPos()
  1878.             if  SmegHack.Options["Misc_SpectatorsBox_PosX"] != PoX ||  SmegHack.Options["Misc_SpectatorsBox_PosY"] != PoY then
  1879.                 SmegHack.Options["Misc_SpectatorsBox_PosX"], SmegHack.Options["Misc_SpectatorsBox_PosY"] = PoX, PoY
  1880.             end
  1881.             local TempSpecsTable = {}
  1882.             for k, v in pairs(player.GetAll()) do
  1883.                 if v:GetObserverTarget() == LocalPlayer() then
  1884.                     table.insert( TempSpecsTable, v:Nick() )
  1885.                 end
  1886.             end
  1887.             if table.concat(TempSpecsTable) != table.concat(SpecsTable) then
  1888.                 if !SpecsListBool && !Wait then
  1889.                     SpecsListBool = true
  1890.                     timer.Simple( 0.1, function() SpecsListBool = false Wait = true end )
  1891.                 elseif Wait then
  1892.                     SpecsTable = table.Copy(TempSpecsTable)
  1893.                     local TextWidth, Tall = 140, 30
  1894.                     local OldWidth, OldTall = DisplayBox:GetSize()
  1895.                     if SpecsTable[1] != nil then
  1896.                         for k, v in pairs(SpecsTable) do
  1897.                             local TempTextWidth = AddLabel( DisplayBox, v, 5, Tall, "Spectators" )
  1898.                             if TempTextWidth > TextWidth then TextWidth = TempTextWidth end
  1899.                             Tall = Tall + 15
  1900.                         end
  1901.                         DisplayBox:SetSize( TextWidth + 10, Tall+5 )
  1902.                     else
  1903.                         AddLabel( DisplayBox, "No Spectators", 5, Tall, "Spectators" )
  1904.                         DisplayBox:SetSize( 150, 50 )
  1905.                     end
  1906.                     local DifferenceX, DifferenceY = OldWidth - TextWidth+10, OldTall - Tall+5
  1907.                     local Var = "SpectatorsBox"
  1908.                     if DifferenceX < 0 then
  1909.                         DifferenceX = DifferenceX * -1
  1910.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] - DifferenceX
  1911.                     else
  1912.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] + DifferenceX
  1913.                     end
  1914.                     if DifferenceY < 0 then
  1915.                         DifferenceY = DifferenceY * -1
  1916.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] - DifferenceY
  1917.                     else
  1918.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] + DifferenceY
  1919.                     end
  1920.  
  1921.                     if SmegHack.Options["Misc_"..Var.."_Mode"] == "Auto" then
  1922.                         local PosX, PosY
  1923.                         if SmegHack.Options["Misc_"..Var.."_PosX"] > ScrW()/2 then PosX = RightPos else PosX = SmegHack.Options["Misc_"..Var.."_PosX"] end
  1924.                         if SmegHack.Options["Misc_"..Var.."_PosY"] > ScrH()/2 then PosY = BottomPos else PosY = SmegHack.Options["Misc_"..Var.."_PosY"] end
  1925.                         DisplayBox:SetPos( PosX, PosY )
  1926.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Top Right" then
  1927.                         DisplayBox:SetPos( RightPos, SmegHack.Options["Misc_"..Var.."_PosY"] )
  1928.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Left" then
  1929.                         DisplayBox:SetPos( SmegHack.Options["Misc_"..Var.."_PosX"], BottomPos )
  1930.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Right" then
  1931.                         DisplayBox:SetPos( RightPos, BottomPos )
  1932.                     end
  1933.                     Wait = false
  1934.                 end
  1935.             end
  1936.         end)
  1937.     end
  1938. end
  1939.  
  1940. function AddSavePage( Parent, Mode )
  1941.     local ManageSaves = vgui.Create("DListView", Parent)
  1942.     ManageSaves:SetPos( 25, 55 )
  1943.     ManageSaves:SetSize( 550, 200 )
  1944.     ManageSaves:SetMultiSelect(false)
  1945.     ManageSaves:AddColumn("Title")
  1946.     ManageSaves:AddColumn("Date Created")
  1947.     function RefreshSaveList(Location, Parent)
  1948.         Parent:Clear()
  1949.         if !file.Exists( "sh/"..Location, "DATA" ) then file.CreateDir( "sh/"..Location ) end
  1950.         if file.Exists( "sh/"..Location, "DATA" ) then
  1951.             local Files, Dirs = file.Find( "sh/"..Location.."/*", "DATA" )
  1952.             for k, v in pairs( Files ) do
  1953.                 local Title = string.StripExtension(v)
  1954.                 local SaveTable = string.Explode( "|", file.Read( "sh/"..Location.."/"..v, "DATA" ) )
  1955.                 local Date = SaveTable[1]
  1956.                 local Time = SaveTable[2]
  1957.                 if Time != nil && Date != nil then
  1958.                     Parent:AddLine(Title, Date.."|"..Time)
  1959.                 else
  1960.                     Parent:AddLine(Title, "This save has been corrupted")
  1961.                 end
  1962.             end
  1963.         end
  1964.     end
  1965.     RefreshSaveList(Mode, ManageSaves)
  1966.    
  1967.     AddTextEntry( Parent, 275, 25, 275, "Input Save Title", Mode )
  1968.     AddGenericButton( Parent, "Refresh Listings", 100, 20, 475, 275, function () RefreshSaveList(Mode, ManageSaves) end )
  1969.     AddGenericButton( Parent, "Delete", 51, 20, 419, 275, function()
  1970.         if ManageSaves:GetSelectedLine() != nil then
  1971.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  1972.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then file.Delete( "sh/"..Mode.."/"..SaveTitle..".txt" ) end
  1973.             RefreshSaveList(Mode, ManageSaves)
  1974.         end
  1975.     end)
  1976.     AddGenericButton( Parent, "Load", 52, 20, 362, 275, function()
  1977.         if ManageSaves:GetSelectedLine() != nil then
  1978.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  1979.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then
  1980.                 local SaveFile = file.Read( "sh/"..Mode.."/"..SaveTitle..".txt" )
  1981.                 local SaveFileTable = string.Explode( "|", SaveFile )
  1982.                 for k, v in pairs( SaveFileTable ) do
  1983.                     if k != 1 && k != 2 then
  1984.                         if ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(2) != "This save has been corrupted" then
  1985.                             if Mode == "Friends" then
  1986.                                 table.insert( SmegHack.FriendsList, v )
  1987.                             elseif Mode == "Configs" then
  1988.                                 if string.Left( v, 1 ) == "{" then
  1989.                                     SmegHack.BoneOrder = util.JSONToTable( v )
  1990.                                 else
  1991.                                     local CommandTable = string.Explode( " ", v )
  1992.                                     if CommandTable[3] == "true" || CommandTable[3] == "false" then
  1993.                                         SmegHack.Options[CommandTable[1]] = tobool(CommandTable[3])
  1994.                                     elseif isnumber(tonumber(CommandTable[3])) then
  1995.                                         SmegHack.Options[CommandTable[1]] = tonumber(CommandTable[3])
  1996.                                     else
  1997.                                         SmegHack.Options[CommandTable[1]] = tostring(CommandTable[3])
  1998.                                     end
  1999.                                 end
  2000.                             elseif Mode == "Entities" then
  2001.                                 table.insert( SmegHack.EntityESP, v )
  2002.                             end
  2003.                         end
  2004.                     end
  2005.                 end
  2006.                 if ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(2) != "This save has been corrupted" then
  2007.                     if Mode == "Friends" then
  2008.                         RefreshFriendsList()
  2009.                     elseif Mode == "Configs" then
  2010.                         //RefreshSaveList( Mode, ManageSaves )
  2011.                         CloseMenu()
  2012.                         ReloadSmegHack(false)
  2013.                     elseif Mode == "Entities" then
  2014.                         RefreshEntsList()
  2015.                     end
  2016.                 end
  2017.             end
  2018.         end
  2019.     end)
  2020.     AddGenericButton( Parent, "Save", 52, 20, 305, 275, function()
  2021.         if SmegHack.TextEntries[Mode] != nil then
  2022.             local Files, Dirs = file.Find( "sh/"..Mode.."/*", "DATA" )
  2023.             for k, v in pairs( Files ) do
  2024.                 local Title = string.StripExtension(v)
  2025.                 if Title == SmegHack.TextEntries[Mode] then return end
  2026.             end
  2027.             if !file.Exists( "sh/"..Mode, "DATA" ) then file.CreateDir( "sh/"..Mode ) end
  2028.             if file.Exists( "sh/"..Mode, "DATA" ) then
  2029.                 if tonumber( os.date("%H"), 10 ) < 12 then
  2030.                     local SaveText = os.date("%d/%m/%y | %I:%M AM")
  2031.                     if Mode == "Friends" then
  2032.                         for k, v in pairs( SmegHack.FriendsList ) do
  2033.                             SaveText = SaveText.."|"..v
  2034.                         end
  2035.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2036.                     elseif Mode == "Configs" then
  2037.                         for k, v in pairs( SmegHack.Options ) do
  2038.                             SaveText = SaveText.."|"..k.." = "..tostring(v)
  2039.                         end
  2040.                         SaveText = SaveText.."|"..util.TableToJSON( SmegHack.BoneOrder )
  2041.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2042.                     elseif Mode == "Entities" then
  2043.                         for k, v in pairs( SmegHack.EntityESP ) do
  2044.                             SaveText = SaveText.."|"..v
  2045.                         end
  2046.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2047.                     end
  2048.                 else
  2049.                     local SaveText = os.date("%d/%m/%y | %I:%M PM")
  2050.                     if Mode == "Friends" then
  2051.                         for k, v in pairs( SmegHack.FriendsList ) do
  2052.                             SaveText = SaveText.."|"..v
  2053.                         end
  2054.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2055.                     elseif Mode == "Configs" then
  2056.                         for k, v in pairs( SmegHack.Options ) do
  2057.                             SaveText = SaveText.."|"..k.." = "..tostring(v)
  2058.                         end
  2059.                         SaveText = SaveText.."|"..util.TableToJSON( SmegHack.BoneOrder )
  2060.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2061.                     elseif Mode == "Entities" then
  2062.                         for k, v in pairs( SmegHack.EntityESP ) do
  2063.                             SaveText = SaveText.."|"..v
  2064.                         end
  2065.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2066.                     end
  2067.                 end
  2068.             end
  2069.             RefreshSaveList(Mode, ManageSaves)
  2070.         end
  2071.     end)
  2072.     AddGenericButton( Parent, "Rename", 52, 20, 305, 300, function()
  2073.         if ManageSaves:GetSelectedLine() != nil && SmegHack.TextEntries[Mode] != nil then
  2074.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  2075.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then
  2076.                 local Files, Dirs = file.Find( "sh/"..Mode.."/*", "DATA" )
  2077.                 for k, v in pairs( Files ) do
  2078.                     local Title = string.StripExtension(v)
  2079.                     if Title == SmegHack.TextEntries[Mode] then return end
  2080.                 end
  2081.                 local SaveFileText = file.Read( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" )
  2082.                 file.Delete( "sh/"..Mode.."/"..SaveTitle..".txt" )
  2083.                 file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveFileText )
  2084.                 RefreshSaveList(Mode, ManageSaves)
  2085.             end
  2086.         end
  2087.     end)
  2088. end
  2089.  
  2090. function SmegHackMenu()
  2091.     if MenuOpen then
  2092.         CloseMenu()
  2093.         return
  2094.     end
  2095.     MenuOpen = true
  2096.     //Menu Frame
  2097.     local Menu = vgui.Create("DFrame")
  2098.     Menu:SetTitle("")
  2099.     Menu:ShowCloseButton(false)
  2100.     Menu:SetDraggable(true)
  2101.     Menu:SetSize(600, 400)
  2102.     Menu:Center()
  2103.     Menu:MakePopup()
  2104.     function Menu:Paint( w, h )
  2105.         //Title Bar
  2106.         draw.RoundedBox( 0, 0, 0, w, 24, Color(0,0,0,255) )
  2107.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,10,20,245) )
  2108.        
  2109.         draw.SimpleText( "Smeg Hack", "Menu_Title", w/2, 11, Color(0,100,200), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2110.         draw.SimpleText( "FPS: "..FPSValue, "ESP_Font_Main", 5, 2, Color(0,255,0),TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
  2111.         draw.SimpleText( "Ping: "..LocalPlayer():Ping(), "ESP_Font_Main", 65, 2, Color(0,255,0), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
  2112.        
  2113.         //Menu Tabs
  2114.         draw.RoundedBox( 0, 0, 25, w, 30, Color(128,128,128,255) )
  2115.         surface.SetDrawColor( Color(0,0,0) )
  2116.         surface.DrawLine( 0, 24, w, 24 )
  2117.         surface.DrawLine( 0, 55, w, 55 )
  2118.         surface.DrawLine( 0, 24, 0, 55 )
  2119.         surface.DrawLine( 50, 24, 50, 55 )
  2120.         surface.DrawLine( 100, 24, 100, 55 )
  2121.         surface.DrawLine( 150, 24, 150, 55 )
  2122.         surface.DrawLine( 200, 24, 200, 55 )
  2123.         surface.DrawLine( 250, 24, 250, 55 )
  2124.         surface.DrawLine( 300, 24, 300, 55 )
  2125.         surface.DrawLine( 350, 24, 350, 55 )
  2126.         surface.DrawLine( 400, 24, 400, 55 )
  2127.         surface.DrawLine( 450, 24, 450, 55 )
  2128.         surface.DrawLine( 500, 24, 500, 55 )
  2129.         surface.DrawLine( 550, 24, 550, 55 )
  2130.         surface.DrawLine( 599, 24, 599, 55 )
  2131.     end
  2132.    
  2133.     //Tab Frames
  2134.     local Main = vgui.Create("DPanel", Menu)
  2135.     Main:SetPos( 0 , 25 )
  2136.     Main:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2137.     Main:SetVisible( false )
  2138.     function Main:Paint()
  2139.         draw.RoundedBox( 0, 1, 0, 49, 30, Color(0,0,255,255) )
  2140.     end
  2141.    
  2142.     local Aimbot = vgui.Create("DPanel", Menu)
  2143.     Aimbot:SetPos( 0 , 25 )
  2144.     Aimbot:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2145.     Aimbot:SetVisible( false )
  2146.     function Aimbot:Paint()
  2147.         draw.RoundedBox( 0, 51, 0, 49, 30, Color(0,0,255,255) )
  2148.  
  2149.         surface.SetDrawColor( Color(255,255,255,255) )
  2150.  
  2151.         //Head
  2152.         surface.DrawCircle( 490, 75, 30, {255,255,255,255} )
  2153.  
  2154.         //Spine
  2155.         surface.DrawLine( 490, 105, 490, 255 )
  2156.  
  2157.         //Arms
  2158.         surface.DrawLine( 490, 180, 440, 130 )
  2159.         surface.DrawLine( 490, 180, 540, 130 )
  2160.         //Hands
  2161.         surface.DrawLine( 440, 130, 420, 130 )
  2162.         surface.DrawLine( 540, 130, 560, 130 )
  2163.  
  2164.         //Legs
  2165.         surface.DrawLine( 490, 255, 440, 305 )
  2166.         surface.DrawLine( 490, 255, 540, 305 )
  2167.         //Feet
  2168.         surface.DrawLine( 440, 305, 400, 305 )
  2169.         surface.DrawLine( 540, 305, 580, 305 )
  2170.     end
  2171.    
  2172.     local ESP = vgui.Create("DPanel", Menu)
  2173.     ESP:SetPos( 0 , 25 )
  2174.     ESP:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2175.     ESP:SetVisible( false )
  2176.     function ESP:Paint()
  2177.         draw.RoundedBox( 0, 101, 0, 49, 30, Color(0,0,255,255) )
  2178.     end
  2179.    
  2180.     local Ents = vgui.Create("DPanel", Menu)
  2181.     Ents:SetPos( 0 , 25 )
  2182.     Ents:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2183.     Ents:SetVisible( false )
  2184.     function Ents:Paint()
  2185.         draw.RoundedBox( 0, 151, 0, 49, 30, Color(0,0,255,255) )
  2186.     end
  2187.    
  2188.     local Misc = vgui.Create("DPanel", Menu)
  2189.     Misc:SetPos( 0 , 25 )
  2190.     Misc:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2191.     Misc:SetVisible( false )
  2192.     function Misc:Paint()
  2193.         draw.RoundedBox( 0, 201, 0, 49, 30, Color(0,0,255,255) )
  2194.     end
  2195.    
  2196.     local Friends = vgui.Create("DPanel", Menu)
  2197.     Friends:SetPos( 0 , 25 )
  2198.     Friends:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2199.     Friends:SetVisible( false )
  2200.     function Friends:Paint()
  2201.         draw.RoundedBox( 0, 251, 0, 49, 30, Color(0,0,255,255) )
  2202.         draw.SimpleText( "Friends                                                       Enemies", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2203.     end
  2204.    
  2205.     local Cams = vgui.Create("DPanel", Menu)
  2206.     Cams:SetPos( 0 , 25 )
  2207.     Cams:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2208.     Cams:SetVisible( false )
  2209.     function Cams:Paint()
  2210.         draw.RoundedBox( 0, 301, 0, 49, 30, Color(0,0,255,255) )
  2211.     end
  2212.    
  2213.     local Bhop = vgui.Create("DPanel", Menu)
  2214.     Bhop:SetPos( 0 , 25 )
  2215.     Bhop:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2216.     Bhop:SetVisible( false )
  2217.     function Bhop:Paint()
  2218.         draw.RoundedBox( 0, 351, 0, 49, 30, Color(0,0,255,255) )
  2219.     end
  2220.    
  2221.     local Spam = vgui.Create("DPanel", Menu)
  2222.     Spam:SetPos( 0 , 25 )
  2223.     Spam:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2224.     Spam:SetVisible( false )
  2225.     function Spam:Paint()
  2226.         draw.RoundedBox( 0, 401, 0, 49, 30, Color(0,0,255,255) )
  2227.     end
  2228.    
  2229.     local Test10 = vgui.Create("DPanel", Menu)
  2230.     Test10:SetPos( 0 , 25 )
  2231.     Test10:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2232.     Test10:SetVisible( false )
  2233.     function Test10:Paint()
  2234.         draw.RoundedBox( 0, 451, 0, 49, 30, Color(0,0,255,255) )
  2235.     end
  2236.    
  2237.     local Test11 = vgui.Create("DPanel", Menu)
  2238.     Test11:SetPos( 0 , 25 )
  2239.     Test11:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2240.     Test11:SetVisible( false )
  2241.     function Test11:Paint()
  2242.         draw.RoundedBox( 0, 501, 0, 49, 30, Color(0,0,255,255) )
  2243.     end
  2244.    
  2245.     local Config = vgui.Create("DPanel", Menu)
  2246.     Config:SetPos( 0 , 25 )
  2247.     Config:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2248.     Config:SetVisible( false )
  2249.     function Config:Paint()
  2250.         draw.RoundedBox( 0, 551, 0, 48, 30, Color(0,0,255,255) )
  2251.         draw.SimpleText( "Configuration save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2252.     end
  2253.    
  2254.     local FriendSaves = vgui.Create("DPanel", Menu)
  2255.     FriendSaves:SetPos( 0 , 25 )
  2256.     FriendSaves:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2257.     FriendSaves:SetVisible( false )
  2258.     function FriendSaves:Paint()
  2259.         draw.RoundedBox( 0, 251, 0, 49, 30, Color(0,0,255,255) )
  2260.         draw.SimpleText( "Friends list save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2261.     end
  2262.    
  2263.     local EntitySaves = vgui.Create("DPanel", Menu)
  2264.     EntitySaves:SetPos( 0 , 25 )
  2265.     EntitySaves:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2266.     EntitySaves:SetVisible( false )
  2267.     function EntitySaves:Paint()
  2268.         draw.RoundedBox( 0, 151, 0, 49, 30, Color(0,0,255,255) )
  2269.         draw.SimpleText( "Entity ESP save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2270.     end
  2271.  
  2272.     local CustomCrosshair = vgui.Create("DPanel", Menu)
  2273.     CustomCrosshair:SetPos( 0 , 25 )
  2274.     CustomCrosshair:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2275.     CustomCrosshair:SetVisible( false )
  2276.     function CustomCrosshair:Paint()
  2277.         draw.RoundedBox( 0, 101, 0, 49, 30, Color(0,0,255,255) )
  2278.         draw.SimpleText( "Custom Crosshair", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2279.     end
  2280.    
  2281.     //Close Button     
  2282.     local CloseButton = vgui.Create("DButton", Menu)
  2283.     CloseButton:SetSize(24, 24)
  2284.     CloseButton:SetPos(Menu:GetWide()-24, 0)
  2285.     CloseButton:SetText("X")
  2286.     CloseButton:SetColor(Color(255,255,255))
  2287.     function CloseButton:Paint( w, h )
  2288.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,30,100,200) )
  2289.     end
  2290.     CloseButton.DoClick = function() CloseMenu() end
  2291.    
  2292.     //Panic Button
  2293.     local PanicButton = vgui.Create("DButton", Menu)
  2294.     PanicButton:SetSize(40, 24)
  2295.     PanicButton:SetPos(Menu:GetWide()-64, 0)
  2296.     if GetConVarNumber("SmegHack_Panic") == 1 then
  2297.         PanicButton:SetText("Enable")
  2298.         PanicButton:SetColor(Color(50,200,0,255))
  2299.     else
  2300.         PanicButton:SetText("Disable")
  2301.         PanicButton:SetColor(Color(255,0,0,255))
  2302.     end
  2303.     function PanicButton:Paint( w, h )
  2304.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  2305.     end
  2306.     PanicButton.DoClick = function()
  2307.         if GetConVarNumber("SmegHack_Panic") == 1 then
  2308.             RunConsoleCommand("SmegHack_Panic", 0)
  2309.             PanicButton:SetText("Disable")
  2310.             PanicButton:SetColor(Color(255,0,0,255))
  2311.         else
  2312.             RunConsoleCommand("SmegHack_Panic", 1)
  2313.             PanicButton:SetText("Enable")
  2314.             PanicButton:SetColor(Color(50,200,0,255))
  2315.         end
  2316.     end
  2317.        
  2318.     //Menu Tabs
  2319.     AddMenuTab( Menu, "Main", Main, 1, 25, 1 )
  2320.     AddMenuTab( Menu, "Aimbot", Aimbot, 51, 25, 2 )
  2321.     AddMenuTab( Menu, "ESP", ESP, 101, 25, 3 )
  2322.     AddMenuTab( Menu, "Ents", Ents, 151, 25, 4 )
  2323.     AddMenuTab( Menu, "Misc", Misc, 201, 25, 5 )
  2324.     AddMenuTab( Menu, "Friends", Friends, 251, 25, 6 )
  2325.     AddMenuTab( Menu, "Cams", Cams, 301, 25, 7 )
  2326.     AddMenuTab( Menu, "Bhop", Bhop, 351, 25, 8 )
  2327.     AddMenuTab( Menu, "Spam", Spam, 401, 25, 9 )
  2328.     AddMenuTab( Menu, "Test10", Test10, 451, 25, 10 )
  2329.     AddMenuTab( Menu, "Test11", Test11, 501, 25, 11 )
  2330.     AddMenuTab( Menu, "Config", Config, 551, 25, 12 )
  2331.    
  2332.     function ChangeTab ( Tab, TabID )
  2333.         Main:SetVisible(false)
  2334.         Aimbot:SetVisible(false)
  2335.         ESP:SetVisible(false)
  2336.         Ents:SetVisible(false)
  2337.         Misc:SetVisible(false)
  2338.         Friends:SetVisible(false)
  2339.         Cams:SetVisible(false)
  2340.         Bhop:SetVisible(false)
  2341.         Spam:SetVisible(false)
  2342.         Test10:SetVisible(false)
  2343.         Test11:SetVisible(false)
  2344.         Config:SetVisible(false)
  2345.         FriendSaves:SetVisible(false)
  2346.         EntitySaves:SetVisible(false)
  2347.         CustomCrosshair:SetVisible(false)
  2348.        
  2349.         Tab:SetVisible(true)
  2350.         SmegHack.ActiveTab = TabID
  2351.     end
  2352.    
  2353.     //Main Tab
  2354.     AddMainMenuButton( Main, "Unload Hack", 100, 60, function()
  2355.         CloseMenu()
  2356.         UnloadSmegHack(true)
  2357.     end)
  2358.     AddMainMenuButton( Main, "Reload Hack", 250, 60, function()
  2359.         CloseMenu()
  2360.         ReloadSmegHack(true)
  2361.     end)
  2362.     AddMainMenuButton( Main, "Clear Saved Files", 400, 60, function()
  2363.         if file.Exists( "sh", "DATA" ) then
  2364.             local Files, Dirs = file.Find( "sh/*", "DATA" )
  2365.             for k, v in pairs( Files ) do
  2366.                 file.Delete( "sh/"..v )
  2367.             end
  2368.             for k, v in pairs( Dirs ) do
  2369.                 local Files, Dirs = file.Find( "sh/"..v.."/*", "DATA" )
  2370.                 local Dir = v
  2371.                 for k, v in pairs( Files ) do
  2372.                     file.Delete( "sh/"..Dir.."/"..v )
  2373.                 end
  2374.             end
  2375.         end
  2376.     end)
  2377.    
  2378.     //Aimbot Tab
  2379.     AddCheckBox( Aimbot, "Aimbot", 15, 45, "Enables/Disables Aimbot", "Aimbot_Toggle" )
  2380.     AddCheckBox( Aimbot, "LOS Check", 15, 65, "Only aims at visible players (players within your line of sight)", "Aimbot_LOSCheck" )
  2381.     AddCheckBox( Aimbot, "Auto Wall", 15, 85, "Aim at people behind walls that can be shot through", "Aimbot_AutoWall")
  2382.     AddCheckBox( Aimbot, "Auto Shoot", 100, 85, "Automatically shoot when the aimbot is locked onto someone", "Aimbot_AutoShoot")
  2383.  
  2384.     AddCheckBox( Aimbot, "Aim On Key", 15, 105, "Aimbot only active when selected key is held down", "Aimbot_AimOnKey" )
  2385.     AddKeyBind( Aimbot, 100, 105, "Aimbot_AimOnKey_Key" )
  2386.     AddLabel( Aimbot, "Aim Priority:", 40, 125 )
  2387.     AddComboBox( Aimbot, 100, 125, 100, 15, "Aimbot_AimPriority", {"Distance", "Crosshair"} )
  2388.     AddCheckBox( Aimbot, "Smooth Aim", 15, 145, "Aims at other players slowly (looks more legit)", "Aimbot_SmoothAim")
  2389.     AddSlider( Aimbot, "Aimbot_SmoothAim_Value", 100, 145, 0, 1000, 0 )
  2390.     AddCheckBox( Aimbot, "FOV", 15, 165, "Only aim at players within the selected field of view", "Aimbot_FOV")
  2391.     AddSlider( Aimbot, "Aimbot_FOV_Value", 100, 165, 0, 360, 0 )
  2392.     AddCheckBox( Aimbot, "Stick To Target", 15, 185, "Will stay aiming at the one target as long as they fall within the selected criteria above", "Aimbot_StickToTarget" )
  2393.     AddCheckBox( Aimbot, "Bone Aim", 15, 205, "Aims only at selected bone", "Aimbot_BoneAim" )
  2394.  
  2395.     AddCheckBox( Aimbot, "Team", 15, 245, "Aim at/ignore players on your team", "Aimbot_AimTeam" )
  2396.     AddCheckBox( Aimbot, "Opponents", 15, 265, "Aim at/ignore players on the other team", "Aimbot_AimOpponents" )
  2397.     AddCheckBox( Aimbot, "Friends", 15, 285, "Aim at/ignore players on your friends list", "Aimbot_AimFriends" )
  2398.     AddCheckBox( Aimbot, "Enemies", 15, 305, "Aim at/ignore players on your enemies list", "Aimbot_AimEnemies" )
  2399.     AddCheckBox( Aimbot, "NPCs", 15, 325, "Aim at/ignore NPCs", "Aimbot_AimNPCs" )
  2400.     AddCheckBox( Aimbot, "Spectators", 15, 345, "Aim at/ignore players who are in spectator mode", "Aimbot_AimSpectators" )
  2401.  
  2402.     AddComboBox( Aimbot, 100, 245, 70, 15, "Aimbot_AimTeamV", {"Aim", "Ignore"} )
  2403.     AddComboBox( Aimbot, 100, 265, 70, 15, "Aimbot_AimOpponentsV", {"Aim", "Ignore"} )
  2404.     AddComboBox( Aimbot, 100, 285, 70, 15, "Aimbot_AimFriendsV", {"Aim", "Ignore"} )
  2405.     AddComboBox( Aimbot, 100, 305, 70, 15, "Aimbot_AimEnemiesV", {"Aim", "Ignore"} )
  2406.     AddComboBox( Aimbot, 100, 325, 70, 15, "Aimbot_AimNPCsV", {"Aim", "Ignore"} )
  2407.     AddComboBox( Aimbot, 100, 345, 70, 15, "Aimbot_AimSpectatorsV", {"Aim", "Ignore"} )
  2408.  
  2409.     //AddLabel( Parent, Text, PosX, PosY, CloseOn )
  2410.     AddLabel( Aimbot, "Offset X:", 200, 325 )
  2411.     AddLabel( Aimbot, "Offset Y:", 200, 345 )
  2412.     AddSlider( Aimbot, "Aimbot_OffsetX", 250, 320, -100, 100, 0 )
  2413.     AddSlider( Aimbot, "Aimbot_OffsetY", 250, 340, -100, 100, 0 )
  2414.    
  2415.     AddBoneButton( Aimbot, 490, 75, "ValveBiped.Bip01_Head1" )
  2416.     AddBoneButton( Aimbot, 490, 120, "ValveBiped.Bip01_Neck1" )
  2417.     AddBoneButton( Aimbot, 490, 150, "ValveBiped.Bip01_Spine4" )
  2418.     AddBoneButton( Aimbot, 490, 175, "ValveBiped.Bip01_Spine2" )
  2419.     AddBoneButton( Aimbot, 490, 200, "ValveBiped.Bip01_Spine1" )
  2420.     AddBoneButton( Aimbot, 490, 225, "ValveBiped.Bip01_Spine" )
  2421.     AddBoneButton( Aimbot, 490, 255, "ValveBiped.Bip01_Pelvis" )
  2422.     AddBoneButton( Aimbot, 470, 160, "ValveBiped.Bip01_R_UpperArm" )
  2423.     AddBoneButton( Aimbot, 450, 140, "ValveBiped.Bip01_R_Forearm" )
  2424.     AddBoneButton( Aimbot, 430, 130, "ValveBiped.Bip01_R_Hand" )
  2425.     AddBoneButton( Aimbot, 510, 165, "ValveBiped.Bip01_L_UpperArm" )
  2426.     AddBoneButton( Aimbot, 530, 140, "ValveBiped.Bip01_L_Forearm" )
  2427.     AddBoneButton( Aimbot, 550, 130, "ValveBiped.Bip01_L_Hand" )
  2428.     AddBoneButton( Aimbot, 470, 275, "ValveBiped.Bip01_R_Thigh" )
  2429.     AddBoneButton( Aimbot, 450, 295, "ValveBiped.Bip01_R_Calf" )
  2430.     AddBoneButton( Aimbot, 430, 305, "ValveBiped.Bip01_R_Foot" )
  2431.     AddBoneButton( Aimbot, 410, 305, "ValveBiped.Bip01_R_Toe0" )
  2432.     AddBoneButton( Aimbot, 510, 275, "ValveBiped.Bip01_L_Thigh" )
  2433.     AddBoneButton( Aimbot, 530, 295, "ValveBiped.Bip01_L_Calf" )
  2434.     AddBoneButton( Aimbot, 550, 305, "ValveBiped.Bip01_L_Foot" )
  2435.     AddBoneButton( Aimbot, 570, 305, "ValveBiped.Bip01_L_Toe0" )
  2436.  
  2437.     AddGenericButton( Aimbot, "Fill", 85, 30, 400, 325, function()
  2438.         for k, v in pairs(SmegHack.Bones) do
  2439.             if !table.HasValue( SmegHack.BoneOrder, v ) then
  2440.                 table.insert( SmegHack.BoneOrder, v )
  2441.             end
  2442.         end
  2443.         UpdateBoneThink = true
  2444.     end)
  2445.     AddGenericButton( Aimbot, "Clear", 85, 30, 495, 325, function()
  2446.         table.Empty( SmegHack.BoneOrder )
  2447.         UpdateBoneThink = true
  2448.     end)
  2449.    
  2450.  
  2451.     //ESP Tab
  2452.     AddCheckBox( ESP, "ESP", 15, 45, "Enables/Disables ESP", "ESP_Toggle" )
  2453.     AddCheckBox( ESP, "Team", 15, 65, "Draw/Ignore ESP for players on your team", "ESP_ShowTeam" )
  2454.     AddCheckBox( ESP, "Opponents", 15, 85, "Draw/Ignore ESP for players not on your team", "ESP_ShowOpponents" )
  2455.     AddCheckBox( ESP, "Friends", 15, 105, "Draw/Ignore ESP for players on your friends list", "ESP_ShowFriends" )
  2456.     AddCheckBox( ESP, "Enemies", 15, 125, "Draw/Ignore ESP for players on your enemies list", "ESP_ShowEnemies" )
  2457.     AddCheckBox( ESP, "NPCs", 15, 145, "Draw/Ignore ESP for NPCs", "ESP_ShowNPCs" )
  2458.     AddCheckBox( ESP, "Spectators", 15, 165, "Draw/Ignore ESP for spectators", "ESP_ShowSpectators" )
  2459.  
  2460.     AddComboBox( ESP, 100, 65, 70, 15, "ESP_ShowTeamV", {"Show", "Ignore"} )
  2461.     AddComboBox( ESP, 100, 85, 70, 15, "ESP_ShowOpponentsV", {"Show", "Ignore"} )
  2462.     AddComboBox( ESP, 100, 105, 70, 15, "ESP_ShowFriendsV", {"Show", "Ignore"} )
  2463.     AddComboBox( ESP, 100, 125, 70, 15, "ESP_ShowEnemiesV", {"Show", "Ignore"} )
  2464.     AddComboBox( ESP, 100, 145, 70, 15, "ESP_ShowNPCsV", {"Show", "Ignore"} )
  2465.     AddComboBox( ESP, 100, 165, 70, 15, "ESP_ShowSpectatorsV", {"Show", "Ignore"} )
  2466.  
  2467.     AddCheckBox( ESP, "Boundary Boxes", 15, 190, "Display a box around players", "ESP_BoundaryBoxes" )
  2468.     AddComboBox( ESP, 120, 190, 35, 15, "ESP_BoundaryBoxes_Mode", { "2D", "3D" } )
  2469.     AddCheckBox( ESP, "Name Tags", 15, 210, "Display player names", "ESP_NameTags" )
  2470.     AddCheckBox( ESP, "Weapon", 15, 230, "Display equipped weapon of players", "ESP_Weapon" )
  2471.     AddCheckBox( ESP, "Distance", 15, 250, "Display distance between you and other players", "ESP_Distance" )
  2472.     AddCheckBox( ESP, "Health", 15, 270, "Display health of players", "ESP_Health" )
  2473.     AddCheckBox( ESP, "Skeleton", 15, 290, "Draws the skeleton of players", "ESP_Skeleton" )
  2474.     AddCheckBox( ESP, "Crosshair", 15, 310, "Draws crosshair on screen", "ESP_Crosshair" )
  2475.     AddGenericButton( ESP, "Customize", 80, 15, 90, 310, function() ChangeTab(CustomCrosshair,15) end )
  2476.  
  2477.     AddCheckBox( ESP, "Entity ESP", 185, 65, "Draw ESP for selected entities", "ESP_Entity_Toggle" )
  2478.     AddCheckBox( ESP, "Name Tags", 185, 85, "Draw ESP for selected entities", "ESP_Entities_NameTags" )
  2479.     AddCheckBox( ESP, "Boundary Boxes", 185, 105, "Draw ESP for selected entities", "ESP_Entities_BoundaryBoxes" )
  2480.     AddComboBox( ESP, 290, 105, 40, 15, "ESP_Entities_BoundaryBoxes_Mode", { "2D", "3D" } )
  2481.  
  2482.     //Crosshair Custimization
  2483.     AddGenericButton( CustomCrosshair, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( ESP, 3 ) end )
  2484.     AddLabel( CustomCrosshair, "Size:", 15, 60 )
  2485.     AddLabel( CustomCrosshair, "Mode:", 15, 80)
  2486.     AddSlider( CustomCrosshair, "ESP_Crosshair_Size", 50, 60, 1, ScrW()/2, 0 )
  2487.     AddComboBox( CustomCrosshair, 50, 80, 105, 15, "ESP_Crosshair_Mode", { "Team", "Custom" } )
  2488.  
  2489.     local Mixer = vgui.Create( "DColorMixer", CustomCrosshair )
  2490.     Mixer:SetSize( 250, 160 )
  2491.     Mixer:SetPos( 335, 60 )
  2492.     Mixer:SetPalette( false )
  2493.     Mixer:SetAlphaBar( true )
  2494.     Mixer:SetWangs( true )
  2495.     if SmegHack.Options["ESP_Crosshair_Mode"] == "Team" then
  2496.         Mixer:SetColor( team.GetColor(LocalPlayer():Team()) )
  2497.     else
  2498.         Mixer:SetColor( Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"], SmegHack.Options["ESP_Crosshair_Color_A"]) )
  2499.     end
  2500.     Mixer.Think = function()
  2501.         if SmegHack.Options["ESP_Crosshair_Mode"] == "Custom" then
  2502.             SmegHack.Options["ESP_Crosshair_Color_R"] = Mixer:GetColor().r
  2503.             SmegHack.Options["ESP_Crosshair_Color_G"] = Mixer:GetColor().g
  2504.             SmegHack.Options["ESP_Crosshair_Color_B"] = Mixer:GetColor().b
  2505.         end
  2506.         SmegHack.Options["ESP_Crosshair_Color_A"] = Mixer:GetColor().a
  2507.     end
  2508.  
  2509.     //Ents Tab
  2510.     local ESPOffEntsList = vgui.Create("DListView", Ents)
  2511.     ESPOffEntsList:SetPos( 25, 55 )
  2512.     ESPOffEntsList:SetSize( 225, 295 )
  2513.     ESPOffEntsList:SetMultiSelect(false)
  2514.     ESPOffEntsList:AddColumn("Off ESP")
  2515.    
  2516.     local ESPOnEntsList = vgui.Create("DListView", Ents)
  2517.     ESPOnEntsList:SetPos( 350, 55 )
  2518.     ESPOnEntsList:SetSize( 225, 295 )
  2519.     ESPOnEntsList:SetMultiSelect(false)
  2520.     ESPOnEntsList:AddColumn("On ESP")
  2521.    
  2522.     function RefreshEntsList()
  2523.         ESPOnEntsList:Clear()
  2524.         ESPOffEntsList:Clear()
  2525.         for k, v in pairs( SmegHack.EntityESP ) do
  2526.             ESPOnEntsList:AddLine(v)
  2527.         end
  2528.         for k, v in pairs( ents.GetAll() ) do
  2529.             local Name = v:GetClass()
  2530.             local Copy = false
  2531.             if Name != "player" then
  2532.                 if !table.HasValue( SmegHack.EntityESP, Name ) then
  2533.                     for k, v in pairs (ESPOffEntsList:GetLines() ) do
  2534.                         if v:GetValue(1) == Name then Copy = true end
  2535.                     end
  2536.                     if Copy == false then ESPOffEntsList:AddLine(Name) end
  2537.                 end
  2538.             end
  2539.         end
  2540.     end
  2541.     RefreshEntsList()
  2542.    
  2543.     AddGenericButton( Ents, "Refresh", 80, 30, 260, 55, function() RefreshEntsList() end )
  2544.     AddGenericButton( Ents, "------->", 80, 30, 260, 167.5, function()
  2545.         if ESPOffEntsList:GetSelectedLine() != nil then
  2546.             table.insert( SmegHack.EntityESP, ESPOffEntsList:GetLine(ESPOffEntsList:GetSelectedLine()):GetValue(1) )
  2547.         end
  2548.         RefreshEntsList()
  2549.     end)
  2550.     AddGenericButton( Ents, "<-------", 80, 30, 260, 207.5, function()
  2551.         if ESPOnEntsList:GetSelectedLine() != nil then
  2552.             for k, v in pairs( SmegHack.EntityESP ) do
  2553.                 if v == ESPOnEntsList:GetLine(ESPOnEntsList:GetSelectedLine()):GetValue(1) then
  2554.                     table.remove( SmegHack.EntityESP, k )
  2555.                 end
  2556.             end
  2557.         end
  2558.         RefreshEntsList()
  2559.     end)
  2560.     AddGenericButton( Ents, "Add All", 80, 30, 260, 95, function()
  2561.         for k, v in pairs( ESPOffEntsList:GetLines() ) do
  2562.             table.insert( SmegHack.EntityESP, v:GetValue(1) )
  2563.         end
  2564.         RefreshEntsList()
  2565.     end)
  2566.     AddGenericButton( Ents, "Clear Ents", 80, 30, 260, 280, function() table.Empty( SmegHack.EntityESP ) RefreshEntsList() end )
  2567.     AddGenericButton( Ents, "Manage Saves", 80, 30, 260, 320, function() ChangeTab(EntitySaves, 14) end )
  2568.    
  2569.     //Entity Saves Manager
  2570.     AddSavePage( EntitySaves, "Entities" )
  2571.     AddGenericButton( EntitySaves, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( Ents, 4 ) end )
  2572.  
  2573.     //Misc Tab
  2574.     AddCheckBox( Misc, "Clock Speed Manipulator", 15, 45, "Speed hack", "Misc_Clock", function()
  2575.         if SmegHack.Options["Misc_Clock"] then
  2576.             TimeScaleChange = true
  2577.         else
  2578.             LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats)
  2579.             LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale)
  2580.         end
  2581.     end)
  2582.     AddSlider( Misc, "Misc_Clock_Speed", 160, 45, 0, 10, 0 )
  2583.     AddComboBox( Misc, 300, 45, 50, 15, "Misc_Clock_Mode", {"Fast", "Slow"}, function() TimeScaleChange = true end )
  2584.  
  2585.     AddCheckBox( Misc, "Admin Box", 15, 65, "Display all admins in a box", "Misc_AdminBox", function()
  2586.         if SmegHack.Options["Misc_AdminBox"] then
  2587.             AddDisplayBox( "Admins", 1 )
  2588.         end
  2589.     end)
  2590.     AddComboBox( Misc, 120, 65, 90, 15, "Misc_AdminBox_Mode", {"Auto", "Top Left", "Top Right", "Bottom Left", "Bottom Right"} )
  2591.     AddCheckBox( Misc, "Spectators Box", 15, 85, "Display all people spectating you in a box", "Misc_SpectatorsBox", function()
  2592.         if SmegHack.Options["Misc_SpectatorsBox"] then
  2593.             AddDisplayBox( "Spectators", 2 )
  2594.         end
  2595.     end)
  2596.     AddComboBox( Misc, 120, 85, 90, 15, "Misc_SpectatorsBox_Mode", {"Auto", "Top Left", "Top Right", "Bottom Left", "Bottom Right"} )
  2597.    
  2598.     //Friends Tab
  2599.     local FriendsList = vgui.Create("DListView", Friends)
  2600.     FriendsList:SetPos( 25, 55 )
  2601.     FriendsList:SetSize( 275, 200 )
  2602.     FriendsList:SetMultiSelect(false)
  2603.     FriendsList:AddColumn("Player Name")
  2604.     FriendsList:AddColumn("Steam ID")
  2605.    
  2606.     local EnemiesList = vgui.Create("DListView", Friends)
  2607.     EnemiesList:SetPos( 300, 55 )
  2608.     EnemiesList:SetSize( 275, 200 )
  2609.     EnemiesList:SetMultiSelect(false)
  2610.     EnemiesList:AddColumn("Player Name")
  2611.     EnemiesList:AddColumn("Steam ID")
  2612.    
  2613.     function RefreshFriendsList()
  2614.         FriendsList:Clear()
  2615.         EnemiesList:Clear()
  2616.         for k, v in pairs(player.GetAll()) do
  2617.             if v != LocalPlayer() then
  2618.                 if SmegHack.Options["Friends_SteamFriends"] && v:GetFriendStatus() == "friend" then
  2619.                     if !table.HasValue(SmegHack.FriendsList, v:SteamID()) then table.insert(SmegHack.FriendsList, v:SteamID()) end
  2620.                 end
  2621.                 if SmegHack.Options["Friends_SteamEnemies"] && v:GetFriendStatus() == "friend" then
  2622.                     local PlayerSteamID = v:SteamID()
  2623.                     for k, v in pairs(SmegHack.FriendsList) do
  2624.                         if v == PlayerSteamID then
  2625.                             table.remove(SmegHack.FriendsList, k)
  2626.                         end
  2627.                     end
  2628.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then table.remove(SmegHack.FriendsList, v:SteamID()) end
  2629.                 end
  2630.                 if SmegHack.Options["Friends_FriendIsEnemy"] then
  2631.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then
  2632.                         EnemiesList:AddLine(v:Nick(), v:SteamID())
  2633.                     else
  2634.                         FriendsList:AddLine(v:Nick(), v:SteamID())
  2635.                     end
  2636.                 else
  2637.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then
  2638.                         FriendsList:AddLine(v:Nick(), v:SteamID())
  2639.                     else
  2640.                         EnemiesList:AddLine(v:Nick(), v:SteamID())
  2641.                     end
  2642.                 end
  2643.             end
  2644.         end
  2645.     end
  2646.     RefreshFriendsList()
  2647.    
  2648.     AddMainMenuButton( Friends, "Remove Friend", 112.5, 260, function()
  2649.         local SelectedLine = FriendsList:GetSelectedLine()
  2650.         if SelectedLine != nil then
  2651.             local PlayerNick = FriendsList:GetLine(SelectedLine):GetValue(1)
  2652.             local PlayerSteamID = FriendsList:GetLine(SelectedLine):GetValue(2)
  2653.             if SmegHack.Options["Friends_FriendIsEnemy"] then
  2654.                 table.insert(SmegHack.FriendsList, PlayerSteamID)
  2655.             else
  2656.                 for k, v in pairs(SmegHack.FriendsList) do
  2657.                     if v == PlayerSteamID then
  2658.                         table.remove(SmegHack.FriendsList, k)
  2659.                         break
  2660.                     end
  2661.                 end
  2662.             end
  2663.             RefreshFriendsList()
  2664.         end
  2665.     end)
  2666.    
  2667.     AddMainMenuButton( Friends, "Add Friend", 387.5, 260, function()
  2668.         local SelectedLine = EnemiesList:GetSelectedLine()
  2669.         if SelectedLine != nil then
  2670.             local PlayerNick = EnemiesList:GetLine(SelectedLine):GetValue(1)
  2671.             local PlayerSteamID = EnemiesList:GetLine(SelectedLine):GetValue(2)
  2672.             if SmegHack.Options["Friends_FriendIsEnemy"] then
  2673.                 for k, v in pairs(SmegHack.FriendsList) do
  2674.                     if v == PlayerSteamID then
  2675.                         table.remove(SmegHack.FriendsList, k)
  2676.                         break
  2677.                     end
  2678.                 end
  2679.             else
  2680.                 table.insert(SmegHack.FriendsList, PlayerSteamID)
  2681.             end
  2682.             RefreshFriendsList()
  2683.         end
  2684.     end)
  2685.    
  2686.     AddMainMenuButton( Friends, "Refresh List", (Friends:GetWide()/2)-50, 260, function() RefreshFriendsList() end )
  2687.     AddMainMenuButton( Friends, "Manage Saves", (Friends:GetWide()/2)-50, 300, function() ChangeTab( FriendSaves, 13 ) end )
  2688.     AddMainMenuButton( Friends, "Clear Friends", 387.5, 300, function() table.Empty( SmegHack.FriendsList ) RefreshFriendsList() end )
  2689.     AddCheckBox( Friends, "Friend Is Enemy", 5, 265, "Turns the friends list into the enemies list", "Friends_FriendIsEnemy", function() RefreshFriendsList() end )
  2690.     AddCheckBox( Friends, "Steam Friends", 5, 285, "Make your friends on steam automatically appear on the friends list", "Friends_SteamFriends", function() RefreshFriendsList() end )
  2691.     AddCheckBox( Friends, "Steam Enemies", 5, 305, "Make your friends on steam automatically appear on the enemies list", "Friends_SteamEnemies", function() RefreshFriendsList() end )
  2692.    
  2693.     //Manage Friend Saves
  2694.     AddSavePage( FriendSaves, "Friends" )
  2695.     AddGenericButton( FriendSaves, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( Friends, 6 ) end )
  2696.  
  2697.     //Cams Tab
  2698.     AddCheckBox( Cams, "Cams", 15, 45, "Enables/Disables cams hacks", "Cams_Toggle" )
  2699.     AddCheckBox( Cams, "Client Side Noclip", 15, 65, "Fly around the map freely (everyone else on the server wont see you flying)", "Cams_CSNoclip" )
  2700.     AddSlider( Cams, "Cams_CSNoclip_Speed", 125, 65, 0, 100, 0 )
  2701.     AddCheckBox( Cams, "Thirdperson", 15, 85, "An over shoulder view", "Cams_ThirdPerson" )
  2702.     AddSlider( Cams, "Cams_ThirdPerson_Zoom", 125, 85, 0, 100, 0 )
  2703.  
  2704.     //Bhop Tab
  2705.     AddCheckBox( Bhop, "Bhop", 15, 45, "Enables/Disables Bhop hacks", "Bhop_Toggle" )
  2706.     AddCheckBox( Bhop, "Fast Walk", 15, 65, "Makes you walk slightly faster", "Bhop_FastWalk" )
  2707.     AddCheckBox( Bhop, "Auto Hop", 15, 85, "Hold space to bhop", "Bhop_AutoHop" )
  2708.     AddCheckBox( Bhop, "Auto Strafe", 15, 105, "Automatically turns in the air", "Bhop_AutoStrafe")
  2709.     AddCheckBox( Bhop, "Edge Jump", 15, 125, "Jumps just before an edge", "Bhop_EdgeJump")
  2710.     AddSlider( Bhop, "Bhop_EdgeJump_Distance", 100, 125, 0, 100, 0 )
  2711.     AddCheckBox( Bhop, "Sideways", 15, 145, "Turns your camera so you can bhop normally while in Sideways mode", "Bhop_Sideways")
  2712.     AddCheckBox( Bhop, "W-Only", 15, 165, "Turns your camera so you can bhop normally while in W-Only mode", "Bhop_WOnly")
  2713.  
  2714.     //Spam Tab
  2715.     AddCheckBox( Spam, "Spam", 15, 45, "Enables/Disables Chat Spammer", "Spam_Toggle" )
  2716.     AddCheckBox( Spam, "Delay", 15, 65, "Pauses between each spam for x seeconds", "Spam_Delay" )
  2717.     AddSlider( Spam, "Spam_Delay_Value", 80, 65, 0, 10, 2 )
  2718.     AddCheckBox( Spam, "Anti-Anti-Spam", 15, 85, "Adds a random number to the end of your message to help avoid Anti-Spammers", "Spam_AntiAntiSpam" )
  2719.  
  2720.     AddCheckBox( Spam, "Message 1", 15, 265, "Enable spam message #1", "Spam_Message_1" )
  2721.     AddCheckBox( Spam, "Message 2", 15, 285, "Enable spam message #2", "Spam_Message_2" )
  2722.     AddCheckBox( Spam, "Message 3", 15, 305, "Enable spam message #3", "Spam_Message_3" )
  2723.     AddCheckBox( Spam, "Message 4", 15, 325, "Enable spam message #4", "Spam_Message_4" )
  2724.     AddCheckBox( Spam, "Message 5", 15, 345, "Enable spam message #5", "Spam_Message_5" )
  2725.     AddTextEntry( Spam, 485, 100, 262, "", "Spam1", true )
  2726.     AddTextEntry( Spam, 485, 100, 282, "", "Spam2", true )
  2727.     AddTextEntry( Spam, 485, 100, 302, "", "Spam3", true )
  2728.     AddTextEntry( Spam, 485, 100, 322, "", "Spam4", true )
  2729.     AddTextEntry( Spam, 485, 100, 342, "", "Spam5", true )
  2730.    
  2731.     //Config Tab
  2732.     AddSavePage( Config, "Configs" )
  2733.    
  2734.     if SmegHack.ActiveTab == nil then SmegHack.ActiveTab = 1 end
  2735.     if SmegHack.ActiveTab == 1 then ChangeTab( Main, 1 )
  2736.     elseif SmegHack.ActiveTab == 2 then ChangeTab( Aimbot, 2 )
  2737.     elseif SmegHack.ActiveTab == 3 then ChangeTab( ESP, 3 )
  2738.     elseif SmegHack.ActiveTab == 4 then ChangeTab( Ents, 4 )
  2739.     elseif SmegHack.ActiveTab == 5 then ChangeTab( Misc, 5 )
  2740.     elseif SmegHack.ActiveTab == 6 then ChangeTab( Friends, 6 )
  2741.     elseif SmegHack.ActiveTab == 7 then ChangeTab( Cams, 7 )
  2742.     elseif SmegHack.ActiveTab == 8 then ChangeTab( Bhop, 8 )
  2743.     elseif SmegHack.ActiveTab == 9 then ChangeTab( Spam, 9 )
  2744.     elseif SmegHack.ActiveTab == 10 then ChangeTab( Test10, 10 )
  2745.     elseif SmegHack.ActiveTab == 11 then ChangeTab( Test11, 11 )
  2746.     elseif SmegHack.ActiveTab == 12 then ChangeTab( Config, 12 )
  2747.     elseif SmegHack.ActiveTab == 13 then ChangeTab ( FriendSaves, 13 )
  2748.     elseif SmegHack.ActiveTab == 14 then ChangeTab ( EntitySaves, 14 )
  2749.     elseif SmegHack.ActiveTab == 15 then ChangeTab ( CustomCrosshair, 15 ) end
  2750.  
  2751.     function CloseMenu()
  2752.         MenuOpen = false
  2753.         Menu:Close()
  2754.     end
  2755. end
  2756. LoadSmegHack(true)
  2757. end)
Add Comment
Please, Sign In to add comment