· 9 years ago · Nov 21, 2016, 03:12 AM
1/* Converted by Grampa @ https://Citizenhack.me for easy reading */
2
3concommand.Add("MythX_Load", function()
4 RunString([[
5
6if !MythX.Version or MythX.Version() != 1.9 then print("MythX error; version mismatch") print("ask mythik for the new update") return end
7
8/*=====================
9 Initialization
10=======================*/
11
12--// Prevent lua stack leak //--
13timer.Simple(1, function()
14
15--// Materials //--
16MythX.Mats = {
17 myth = Material( "myth.png", "nocull" ),
18 warning = Material( "icon16/error.png", "nocull" ),
19 info = Material( "icon16/information.png", "nocull" ),
20 keyboard = Material( "icon16/keyboard.png", "nocull" ),
21 bricks = Material( "icon16/bricks.png", "nocull" ),
22 background = Material( "background.png", "nocull" ),
23 arrow = Material( "arrow.png", "nocull" ),
24 border = Material( "border.png", "nocull" ),
25 border2 = Material( "border2.png", "nocull" ),
26 palette = Material( "palette.png", "nocull" ),
27 button = Material( "button.png", "nocull" ),
28 cross = Material( "cross.png", "nocull" ),
29 grad = Material( "grad.png", "nocull" ),
30 grid = Material( "grid.png", "nocull" ),
31 slider = Material( "slider.png", "nocull" ),
32 tick = Material( "tick.png", "nocull" ),
33 x = Material( "x.png", "nocull" );
34}
35
36local blackListEnts = {"env_sprite", "env_skypaint", "physgun_beam", "beam", "dmglog_sync_ent", "viewmodel"}
37local showing = {}
38
39MythX.entlist = {};
40
41--// Font creation //--
42
43-- Menu font large
44surface.CreateFont("Tahoma", {font = "Arial", size = 14, weight = 700, antialias = true})
45
46-- Menu font small
47surface.CreateFont("TahomaS", {font = "Arial", size = 12, weight = 500, antialias = true})
48
49-- ESP Font
50surface.CreateFont("visuals", {font = "Arial", size = 12, weight = 600})
51
52/*=====================
53 CVAR Creation
54=======================*/
55
56--// Convar table //--
57local cvars = {}
58
59--// Convar loop //--
60MythX.Settings = (file.Exists("MythX_Settings.txt", "DATA") and util.JSONToTable(file.Read("MythX_Settings.txt", "DATA"))) or cvars
61for k, v in pairs(cvars) do
62 if MythX.Settings[k] == nil then
63 MythX.Settings = cvars
64 end
65end
66
67--// Convar update function //--
68function update(x,y,z, ok)
69 if x == "setting" then
70 MythX.Settings[y] = z
71 if ok == true then
72 file.Write("MythX_Settings.txt", util.TableToJSON(MythX.Settings))
73 end
74 end
75end
76
77--// Default setting creation //--
78local settings = MythX.Settings -- local convar table
79local menuColor = Color(255,0,0,255) -- default menu color
80local aim_key = MOUSE_5; -- Aim key
81
82--// If setting exists, change menu color //--
83if settings["menu_color"] then
84 menuColor = settings["menu_color"]
85end
86
87--// If setting exists, change aim key //--
88if settings["aim_key"] then
89 aim_key = settings["aim_key"]
90end
91
92/*=====================
93 Utility menu functions
94=======================*/
95
96local Tex_Corner8 = surface.GetTextureID( "gui/corner8" )
97local Tex_Corner16 = surface.GetTextureID( "gui/corner16" )
98local Tex_white = surface.GetTextureID( "vgui/white" )
99local TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP, TEXT_ALIGN_BOTTOM = 0, 1, 2, 3, 4
100
101local function RoundedBoxEx( bordersize, x, y, w, h, color, a, b, c, d )
102 x, y, w, h = math.Round( x ), math.Round( y ), math.Round( w ), math.Round( h )
103
104 surface.SetDrawColor( color.r, color.g, color.b, color.a )
105 surface.DrawRect( x+bordersize, y, w-bordersize*2, h )
106 surface.DrawRect( x, y+bordersize, bordersize, h-bordersize*2 )
107 surface.DrawRect( x+w-bordersize, y+bordersize, bordersize, h-bordersize*2 )
108
109 local tex = Tex_Corner8
110 if ( bordersize > 8 ) then tex = Tex_Corner16 end
111 surface.SetTexture( tex )
112
113 if ( a ) then
114 surface.DrawTexturedRectRotated( x + bordersize/2 , y + bordersize/2, bordersize, bordersize, 0 )
115 else
116 surface.DrawRect( x, y, bordersize, bordersize )
117 end
118
119 if ( b ) then
120 surface.DrawTexturedRectRotated( x + w - bordersize/2 , y + bordersize/2, bordersize, bordersize, 270 )
121 else
122 surface.DrawRect( x + w - bordersize, y, bordersize, bordersize )
123 end
124
125 if ( c ) then
126 surface.DrawTexturedRectRotated( x + bordersize/2 , y + h -bordersize/2, bordersize, bordersize, 90 )
127 else
128 surface.DrawRect( x, y + h - bordersize, bordersize, bordersize )
129 end
130
131 if ( d ) then
132 surface.DrawTexturedRectRotated( x + w - bordersize/2 , y + h - bordersize/2, bordersize, bordersize, 180 )
133 else
134 surface.DrawRect( x + w - bordersize, y + h - bordersize, bordersize, bordersize )
135 end
136end
137
138local function RoundedBox( bordersize, x, y, w, h, color )
139 return RoundedBoxEx( bordersize, x, y, w, h, color, true, true, true, true )
140end
141
142local function SimpleText(text, font, x, y, colour, xalign, yalign)
143 text = tostring( text )
144 font = font or "DermaDefault"
145 x = x or 0
146 y = y or 0
147 xalign = xalign or TEXT_ALIGN_LEFT
148 yalign = yalign or TEXT_ALIGN_TOP
149 surface.SetFont(font)
150 local w, h = surface.GetTextSize( text )
151 if (xalign == TEXT_ALIGN_CENTER) then
152 x = x - w/2
153 elseif (xalign == TEXT_ALIGN_RIGHT) then
154 x = x - w
155 end
156 if (yalign == TEXT_ALIGN_CENTER) then
157 y = y - h/2
158 elseif ( yalign == TEXT_ALIGN_BOTTOM ) then
159 y = y - h
160 end
161 surface.SetTextPos( math.ceil( x ), math.ceil( y ) );
162 if (colour!=nil) then
163 local alpha = 255
164 if (colour.a) then alpha = colour.a end
165 surface.SetTextColor( colour.r, colour.g, colour.b, alpha )
166 else
167 surface.SetTextColor(255, 255, 255, 255)
168 end
169 surface.DrawText(text)
170 return w, h
171end
172
173local function SimpleTextOutlined(text, font, x, y, colour, xalign, yalign, outlinewidth, outlinecolour)
174 local steps = (outlinewidth*2) / 3
175 if ( steps < 1 ) then steps = 1 end
176 for _x=-outlinewidth, outlinewidth, steps do
177 for _y=-outlinewidth, outlinewidth, steps do
178 SimpleText(text, font, x + (_x), y + (_y), outlinecolour, xalign, yalign)
179 end
180 end
181 return SimpleText(text, font, x, y, colour, xalign, yalign)
182end
183
184local notifyOn, nmsg, nlabel, nicon, ncolor;
185local function notify(icon, label, msg, time, sound, color)
186 if sound then
187 surface.PlaySound("HL1/fvox/warning.wav")
188 end
189
190 notifyOn = true;
191 nmsg, nlabel, nicon, ncolor = msg, label, icon, color;
192 timer.Simple(time, function() notifyOn, nmsg, nlabel, nicon, ncolor = nil end)
193end
194
195/*=====================
196 Menu derma creation
197=======================*/
198
199local points = {};
200local options = {};
201
202local x, y = -160, ScrH() / 2 - 75
203local w = 100
204local key = 16;
205local opamt = 0;
206local toMinus = -160
207local oi = 0;
208
209local mdown = false;
210local mrel = false;
211local menuOpen = false;
212local opened = false;
213local key_down = false;
214local key_rel = false;
215local menu_toggle = false;
216local Mixer;
217
218local textCol = Color(255,0,0,255)
219
220for i = 0, #options do
221 tabAmt = i;
222end
223
224--// Essentially player.GetAll() //--
225local function getPlayers()
226 local players = {}
227 for i = 1, MythX.GetMaxPlayers() do
228 if MythX.GetEntity(i) then
229 if MythX.GetEntity(i):GetClass() == "player" then
230 local ply = MythX.GetEntity(i):ToPlayer();
231 players[i] = MythX.GetEntity(i):ToPlayer();
232 end
233 end
234 end
235 return players;
236end
237
238local function getEnts()
239 local players = {}
240 for i = 1, MythX.GetMaxEnts() do
241 if MythX.GetEntity(i) then
242 local ply = MythX.GetEntity(i);
243 players[i] = MythX.GetEntity(i);
244 end
245 end
246 return players;
247end
248
249local function get_owner(ent)
250 for k, v in next, getPlayers() do
251 if ent:GetAbsPos():Distance(v:GetAbsPos()) == 36 then
252 return v
253 end
254 end
255end
256
257local aim_friends = {} -- Aimbot friends list
258
259--// Derma list creation //--
260function MythX:CreateList(x, y, listname1, listname2, tbl)
261 local DFrame = vgui.Create("DFrame")
262 DFrame:SetPos(x, y)
263 DFrame:SetSize(275, 240)
264 DFrame:SetTitle("")
265
266 local enemylist = vgui.Create( "DListView", DFrame )
267 enemylist:AddColumn( listname1 )
268 enemylist:SetPos( 8, 32 )
269 enemylist:SetSize(100, 200)
270 enemylist:SetDrawBackground(false)
271 enemylist.Paint = function()
272 RoundedBox( 0, 0, 0, enemylist:GetWide(), enemylist:GetTall(), Color( 150, 150, 150, 255 ) )
273 end
274
275 local friendlist = vgui.Create( "DListView", DFrame )
276 friendlist:AddColumn( listname2 )
277 friendlist:SetPos( 167, 32 )
278 friendlist:SetSize(100, 200)
279 friendlist:SetDrawBackground(false)
280 friendlist.Paint = function()
281 RoundedBox( 0, 0, 0, friendlist:GetWide(), friendlist:GetTall(), Color( 150, 150, 150, 255 ) )
282 end
283
284 local addbutton = vgui.Create( "DButton", DFrame )
285 addbutton:SetPos( 113, 90 )
286 addbutton:SetSize( 50, 30 )
287 addbutton:SetText("")
288 addbutton.PaintOver = function() SimpleText(">", "BudgetLabel", 20, 8, Color(255,255,255,255)) end
289 addbutton.DoClick = function()
290 if enemylist:GetSelectedLine() != nil then
291 local linename = enemylist:GetLine( enemylist:GetSelectedLine() ):GetValue(1)
292 if !table.HasValue(tbl, linename) then
293 table.insert(tbl, linename)
294 enemylist:RemoveLine(enemylist:GetSelectedLine())
295 friendlist:AddLine(linename)
296 end
297 end
298 end
299
300 local removebutton = vgui.Create( "DButton", DFrame )
301 removebutton:SetPos( 113, 130 )
302 removebutton:SetSize( 50, 30 )
303 removebutton:SetText("")
304 removebutton.PaintOver = function() SimpleText("<", "BudgetLabel", 20, 8, Color(255,255,255,255)) end
305 removebutton.DoClick = function()
306 if friendlist:GetSelectedLine() != nil then
307 local linename = friendlist:GetLine(friendlist:GetSelectedLine()):GetValue(1)
308 if table.HasValue( tbl, linename ) then
309 for k, v in next, tbl do
310 if v == linename then
311 table.remove( tbl, k )
312 end
313 end
314
315 friendlist:RemoveLine(friendlist:GetSelectedLine())
316 enemylist:AddLine(linename)
317
318 end
319 end
320 end
321
322 DFrame:MakePopup();
323
324 local friends, loopTable, loopFunc = {}, nil, nil;
325
326 if listname1 == "Players" then
327 loopTable = getPlayers()
328 elseif listname1 == "Entities" then
329 loopTable = getEnts()
330 else
331 loopTable = nil;
332 end
333
334 if not loopTable then return end
335
336 for k, v in next,( loopTable ) do
337 if !v then continue end
338 if listname1 == "Players" and !table.HasValue(friends, v:Nick()) and !table.HasValue(tbl, v:Nick()) and v != LocalPlayer() then
339 table.insert( friends, v:Nick() )
340 elseif listname1 == "Entities" and !table.HasValue(friends, v:GetClass()) and !table.HasValue(tbl, v:GetClass()) and v != LocalPlayer() then
341 local ent = v:GetClass();
342 if string.sub(ent, 0, 5) == "class" or string.sub(ent, 0, 5) == "func_" or table.HasValue(blackListEnts, ent) then continue end
343 if string.sub(ent, 0, 11) == "weapon_ttt_" then ent = string.sub(ent, 12) end
344 if string.sub(ent, 0, 10) == "weapon_zm_" then ent = string.sub(ent, 11) end
345 if !table.HasValue(friends, ent) and !table.HasValue(tbl, ent) then
346 table.insert( friends, ent)
347 end
348 end
349 end
350
351 table.sort(friends)
352 for k, v in next,( friends ) do
353 enemylist:AddLine( v )
354 end
355
356 table.sort(tbl)
357 for k, v in next, tbl do
358 friendlist:AddLine( v )
359 end
360end
361
362--// Derma aim-key panel //--
363local function aimkey()
364 local Frame = vgui.Create( "DFrame" )
365 Frame:SetSize( 75, 25 ) --good size for example
366 Frame:SetPos(345, y - 12)
367 Frame:SetTitle("Pick a key")
368 Frame.btnClose:SetVisible(false);
369 Frame.btnMinim:SetVisible(false);
370 Frame.btnMaxim:SetVisible(false);
371 Frame.OnMousePressed = function(panel, key)
372 aim_key = key;
373 update("setting", "aim_key", key, true);
374 Frame:Close()
375 end
376 Frame.OnKeyCodePressed = function(panel, key)
377 aim_key = key;
378 update("setting", "aim_key", key, true);
379 Frame:Close()
380 end
381 Frame:MakePopup();
382end
383
384--// Derma text entry panel //--
385local function textEntry(title)
386 local Frame = vgui.Create( "DFrame" )
387 Frame:SetSize( 200, 60 ) --good size for example
388 Frame:SetPos(345, y - 12)
389 Frame:SetTitle("Change name")
390 Frame.btnClose:SetVisible(false);
391 Frame.btnMinim:SetVisible(false);
392 Frame.btnMaxim:SetVisible(false);
393
394 local TextEntry = vgui.Create( "DTextEntry", Frame ) -- create the form as a child of frame
395 TextEntry:SetPos( 5, 30 )
396 TextEntry:SetSize( 190, 25 )
397 TextEntry:SetText( "Sample String" )
398 TextEntry.OnEnter = function( self )
399 MythX.SetName( self:GetValue() )
400 Frame:Close();
401 end
402
403 Frame:MakePopup();
404end
405
406--// function for name stealer //--
407local function nameSteal()
408 local players = getPlayers();
409 local ply = players[ math.random( #players ) ]
410 if !ply then nameSteal() return end
411 if ply == LocalPlayer() then nameSteal() return end
412 if ply:Nick() == LocalPlayer():Nick().." " then nameSteal() return end
413 MythX.SetName(ply:Nick().."‪");
414 notify(MythX.Mats.info, "MythX", "Name has been changed to "..ply:Nick().."!", 3, false, Color(0,255,0))
415end
416
417--// Aimbot friends-list creation //--
418local function friendsList()
419 if !IsInGame() then return end
420 MythX:CreateList(350, ScrH() / 2 - 100, "Players", "Friends", aim_friends)
421end
422
423local function entityList()
424 if !IsInGame() then return end
425 MythX:CreateList(350, ScrH() / 2 - 100, "Entities", "Shown", MythX.entlist)
426end
427
428/*=====================
429 Base Helper
430=======================*/
431
432local basePos;
433local people = {}
434local baseFriends = {}
435local notified = false
436local stored = false
437
438local function baseList()
439 MythX:CreateList(350, ScrH() / 2 - 100, "Players", "Friends", baseFriends)
440end
441
442local function setBase()
443 if !stored then
444 basePos = LocalPlayer():GetAbsPos()
445 notify(MythX.Mats.info, "MythX", "Your base has been set!", 3, false, Color(0,255,0))
446 stored = true
447 else
448 stored = false
449 end
450end
451
452function MythX:baseHelper()
453 if !basePos then return end
454
455 local pos = MythX.ToScreen(basePos)
456
457 SimpleTextOutlined("Your Base :)", "Tahoma", pos.x, pos.y, Color( 255,0,0 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255))
458
459 for k, v in next, getPlayers() do
460 if v == LocalPlayer() then continue end
461 if table.HasValue(baseFriends, v:Nick()) then continue end
462 if v:GetAbsPos():Distance( basePos ) < tonumber(settings["basingDist"]) and !notified then
463 if !table.HasValue(people, v) then
464 table.insert(people, v)
465 end
466
467 notify(MythX.Mats.warning, "Warning!", "Player "..v:Nick().." was found near your base!", 5, true, Color(255,130,0))
468 notified = true
469
470 elseif v:GetAbsPos():Distance( basePos ) > tonumber(settings["basingDist"]) and notified then
471 if table.HasValue(people, v) then
472 table.RemoveByValue(people, v)
473 notified = false
474 end
475 end
476 end
477end
478
479--// Check if mouse is at posistion //--
480local function mouseInBox( x, y, w, h )
481 local mx, my = gui.MousePos();
482 if mx >= x and mx <= x + w and my >= y and my <= y + h then return true; end;
483 return false;
484end;
485
486/*=====================
487 Traitor detector
488=======================*/
489
490local flags = {"weapon_ttt_knife", "weapon_ttt_teleport", "weapon_ttt_sipistol", "weapon_ttt_decoy", "weapon_ttt_phammer", "weapon_ttt_c4", "weapon_ttt_radio", "weapon_ttt_push", "weapon_ttt_flaregun"}
491local traitors = {}
492
493local w, h = 700, 500
494local margin = 15
495local bw, bh = 100, 25
496local xpos, ypos = ScrW() / 2 - (700 / 2), (ScrH() / 2) - 250
497local xpos2, ypos2 = (w - bw - margin), (h - bh - margin/2);
498local xpos3, ypos3 = xpos + xpos2, ypos + ypos2
499
500function MythX.reset_traitors()
501 timer.Simple(1, function()
502 traitors = {}
503 end)
504end
505
506local function detect_traitors()
507 for k, v in next, getEnts() do
508 if table.HasValue(flags, v:GetClass()) then
509 if get_owner(v) and get_owner(v):GetClass() == "player" then
510 if !table.HasValue(traitors, get_owner(v):ToPlayer()) && LocalPlayer():GetTeam() != 1002 && LocalPlayer():Health() > 0 then
511 table.insert(traitors, get_owner(v):ToPlayer())
512 notify(MythX.Mats.info, "MythX", "Player "..get_owner(v):ToPlayer():Nick().." has picked up a traitor weapon!", 3, false, Color(0,255,0))
513 end
514 end
515 end
516 end
517
518 if (mouseInBox(xpos3, ypos3, bw, bh) and mrel) or LocalPlayer():GetTeam() == 1002 or LocalPlayer():Health() <= 0 then
519 MythX.reset_traitors()
520 end
521end
522
523/*=====================
524 Menu creation
525=======================*/
526
527--// enable/disable mouse input //--
528local function mouse(bool)
529 if bool then
530 return MythX.RunString("gui.EnableScreenClicker( true )", false)
531 end
532 return MythX.RunString("gui.EnableScreenClicker( false )", false)
533end
534
535--// Rounding function for sliders //--
536local function round(num, idp)
537 local mult = 10^(idp or 0)
538 return math.floor(num * mult + 0.5) / mult
539end
540
541--// Add menu tab //--
542local function addTab( text )
543 local tab = { };
544 tab.text = text;
545 tab.options = { };
546 tab.i = 0;
547
548 options[oi] = tab;
549 oi = oi + 1;
550end;
551
552--// Add menu tab option //--
553local function addOption( tab, text, ctext, value, type, min, max)
554 local op = { };
555 op.text = text;
556
557 op.convar_text = ctext;
558
559 for k, v in pairs( options ) do
560 if v.text == tab then
561 v.options[ v.i ] = op;
562 v.i = v.i + 1;
563 break;
564 end;
565 end
566
567 cvars[ctext] = value
568
569 if type then
570 op.convar_type = type
571 end
572
573 if type == "button" or type == "key" then
574 op.func = min;
575 end
576
577 if type == "slider" then
578 op.min = min
579 op.max = max
580 points[ctext] = 130 / 2 - 10;
581 end
582end
583
584--// Image drawing function //--
585local function drawSprite(mat, x, y, w, h, col)
586 surface.SetMaterial( mat );
587
588 if col ~= nil then
589 surface.SetDrawColor( col );
590 else
591 surface.SetDrawColor( Color( 255, 255, 255, 255 ) );
592 end
593
594 surface.DrawTexturedRect( x, y, w, h );
595end
596
597--// Slider drawing function //--
598local sliderpoint = 130 / 2 - 10
599local function DrawSlider(x, y, min, max, val, cvar)
600 local toround = 0;
601
602 if min%1 ~= 0 or max%1 ~= 0 then
603 toround = 2;
604 end
605
606 local sliderpos = 6 + x + sliderpoint
607 local value = round(min+((sliderpos-x )/((x + 128) - x))*(max-min), toround)
608 local num = 0;
609
610 if(settings[cvar])then
611 num = settings[cvar]
612 end
613
614 if settings["points"] then
615 if settings["points"][cvar] then
616 points[cvar] = settings["points"][cvar]
617 else
618 settings["points"][cvar] = sliderpoint
619 end
620 end
621
622 if mouseInBox(x + 15, y, 128, 16) and mdown then
623 local mX, mY = gui.MousePos();
624 sliderpoint = mX - 165 - 15
625 points[cvar] = mX - 165 - 15
626 num = math.Clamp(value, min, max);
627 update("setting", cvar, num, true)
628 update("setting", "points", points, true)
629 end
630
631 drawSprite(MythX.Mats.grid, x + 15, y - 2, 128, 16)
632 drawSprite(MythX.Mats.slider, 15 + x + points[cvar], y - 2, 10, 15)
633 SimpleTextOutlined(num, "TahomaS", x + points[cvar] + 20, y + 6, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
634end
635
636--// Menu option loop //--
637local function loop()
638 for i = 0, #options do
639 if not options[ i ] then timer.Create( "loopnShit", 1, 0, loop) return end
640 local op = options[ i ];
641
642 for j = 0, #op.options do
643 if(op.options[j] ~= nil)then
644 op_op = op.options[ j ];
645 op_op.selected = settings[op_op.convar_text]
646 end
647 end;
648
649 tabAmt = i;
650 end;
651end
652loop()
653
654--// Draw menu //--
655local function draw()
656
657 if notifyOn then
658 surface.SetFont( "TahomaS" )
659
660 local textW, textH = surface.GetTextSize( nmsg )
661 local w, h = 150, textH + 8
662
663 if textW > w then
664 w = textW + 8
665 end
666
667 local nX, nY = ScrW() / 2 - (w / 2), 200 - (h / 2)
668
669 RoundedBox(0, nX, nY - 25, w, 25, Color(menuColor.r - 20, menuColor.g - 20, menuColor.b - 20))
670 RoundedBox(0, nX, nY, w, h, Color(40,40,40))
671 drawSprite(nicon, nX + 5, nY - 25 + 5, 16, 16)
672 SimpleTextOutlined(nlabel, "TahomaS", nX + 25, nY - 25 + 13, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
673 SimpleTextOutlined(nmsg, "TahomaS", nX + 5, nY + 9.5, ncolor, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
674 end
675
676 if input.IsKeyDown(KEY_INSERT) and not key_down then key_down = true; end;
677 if key_down and not input.IsKeyDown(KEY_INSERT) then key_rel = true; key_down = false; end;
678
679 if input.IsMouseDown(MOUSE_LEFT) and not mdown then mdown = true; end;
680 if mdown and not input.IsMouseDown(MOUSE_LEFT) then mrel = true; mdown = false; end;
681
682 local fps = FrameTime()
683
684 for i = 0, #options do
685 if options[ i ].selected then
686 toMinus = -320
687 end
688 end
689
690 if key_rel then
691 if !opened then
692 x = math.Clamp( x + 750 * fps, toMinus, 0 );
693 else
694 x = math.Clamp( x - 750 * fps, toMinus, 0 );
695 end
696 end
697
698 if x == 0 and !opened then
699 opened = true;
700 key_rel = false;
701 mouse(true);
702 elseif (x == -160 or x == -320) and opened then
703 opened = false;
704 key_rel = false;
705 mouse(false);
706 end
707
708 if x == -160 or x == -320 then return end
709
710 if Mixer then
711 if Mixer:IsValid() then
712 if Mixer:GetColor() then
713 menuColor = Mixer:GetColor()
714 else
715 menuColor = Color(255,0,0,255)
716 end
717 end
718 end
719
720 for i = 0, #options do
721 drawSprite(MythX.Mats.button, x, 1 + y + (i * 34), 160, 35)
722 drawSprite(MythX.Mats.arrow, x + 140, 1 + y + (i * 34) + 8, 16, 16)
723 end
724
725 drawSprite(MythX.Mats.background, x, y - 33, 160, 35, menuColor)
726 drawSprite(MythX.Mats.myth, x + 13, y - 33, 128, 32)
727 drawSprite(MythX.Mats.x, x + 13, y - 33, 128, 32, menuColor)
728
729 local op_x = x + 79
730 local selected_i = nil;
731 for i = 0, #options do
732 local op = options[ i ];
733 local op_y = y + (i * 34);
734
735 SimpleTextOutlined(op.text, "Tahoma", op_x, op_y + 17.5, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
736
737 if mouseInBox(x, y + (i * 34), 160, 35) then
738 if mrel then
739 selected_i = i;
740 selected_text = op.text;
741 selectedY = i * 34;
742 end
743 end
744
745 if(op.selected)then
746 local text = selected_text;
747 local scaleAmt = 0;
748
749 if opamt > tabAmt then scaleAmt = opamt end
750 if tabAmt >= opamt then scaleAmt = tabAmt end
751
752 RoundedBox(0, x + 160, y + 2, 158, 34 * (scaleAmt + 1), Color(33,33,33,255));
753 drawSprite(MythX.Mats.border, x + 317, y, 2, 2 + 34 * (scaleAmt + 1), menuColor)
754 drawSprite(MythX.Mats.grad, x + 159, y - 33, 160, 35, menuColor)
755 SimpleTextOutlined(text, "Tahoma", (x + 160) + 75, y - 15, menuColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
756 RoundedBox(0, x, y + selectedY + 2, 160, 34, Color(33,33,33,255));
757 drawSprite(MythX.Mats.border, x + 1, y + selectedY + 2, 2, 34, menuColor)
758 SimpleTextOutlined(text, "Tahoma", op_x, y + 17.5 + selectedY, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
759
760 drawSprite(MythX.Mats.palette, x + 295, y - 24, 16, 16)
761
762 if mouseInBox(x + 295, y - 24, 16, 16) and mrel then
763 local worldPanel = vgui.GetWorldPanel();
764
765 local Frame = vgui.Create( "DFrame", worldPanel )
766 Frame:SetSize( 267, 186 ) --good size for example
767 Frame:SetPos(x + 160 + 160 + 15, y - 24)
768 Frame:SetTitle("Pick a color")
769
770 Mixer = vgui.Create( "DColorMixer", Frame )
771 Mixer:Dock( FILL )
772 Mixer:SetPalette( true )
773 Mixer:SetAlphaBar( false )
774 Mixer:SetWangs( true )
775 Mixer:SetColor( menuColor )
776 Mixer.ValueChanged = function()
777 update("setting", "menu_color", Mixer:GetColor(), true)
778 end
779
780 Frame:MakePopup();
781 end
782
783 if opamt > tabAmt then
784 RoundedBox(0, x, y + 36 + (34 * tabAmt), 160, 34 * (opamt - tabAmt), Color(44,44,44,255))
785 drawSprite(MythX.Mats.border, x, y + 36 + (34 * tabAmt), 2, 34 * (opamt - tabAmt), menuColor)
786 drawSprite(MythX.Mats.border2, x, y + 36 + 34 * (opamt - tabAmt) + (34 * tabAmt) - 2, 318, 2, menuColor)
787 else
788 if i == #options then
789 drawSprite(MythX.Mats.border2, x + 1, y + 36 + (34 * tabAmt) - 2, 317, 2, menuColor)
790 else
791 drawSprite(MythX.Mats.border2, x + 160, y + 36 + (34 * tabAmt) - 2, 158, 2, menuColor)
792 end
793 end
794
795 for j = 0, #op.options do
796 if op.options[ j ] ~= nil then
797 local op_op = op.options[ j ];
798
799 local x2 = 250
800
801 if op_op.convar_type == "slider" then
802 SimpleTextOutlined(op.options[ j ].text, "TahomaS", x + 159 + 76, 8 + y + j * 34, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
803 DrawSlider(x + 159, 18 + y + j * 34, op.options[ j ].min, op.options[ j ].max, 50, op.options[ j ].convar_text, op.options[ j ].point)
804 elseif op_op.convar_type == "button" then
805 SimpleTextOutlined(op.options[ j ].text, "TahomaS", x + 194, 18 + y + j * 34, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
806 drawSprite(MythX.Mats.bricks, x + 169, 10 + y + j * 34, 16, 16)
807 elseif op_op.convar_type == "key" then
808 SimpleTextOutlined(op.options[ j ].text, "TahomaS", x + 194, 18 + y + j * 34, Color(0,160,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
809 drawSprite(MythX.Mats.keyboard, x + 169, 10 + y + j * 34, 16, 16)
810 else
811 if op_op.selected then
812 SimpleTextOutlined(op.options[ j ].text, "TahomaS", x + 194, 18 + y + j * 34, Color(0,255,0,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
813 drawSprite(MythX.Mats.tick, x + 169, 10 + y + j * 34, 16, 16)
814 else
815 SimpleTextOutlined(op.options[ j ].text, "TahomaS", x + 194, 18 + y + j * 34, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
816 drawSprite(MythX.Mats.cross, x + 169, 10 + y + j * 34, 16, 16)
817 end
818 end
819
820 if mouseInBox( x + 160, y + 2 + (34 * j), 160, 35 ) then
821
822 if (op_op.convar_type == "button" or op_op.convar_type == "key") and mrel then
823 op.options[ j ].func()
824 end
825
826 if op_op.convar_type ~= "slider" and op_op.convar_type ~= "button" and op_op.convar_type ~= "key" then
827 if mrel then
828 if op_op.selected then
829 op_op.selected = false;
830 update("setting", op_op.convar_text, false, true)
831 else
832 op_op.selected = true;
833 update("setting", op_op.convar_text, true, true)
834 end
835 end
836 end
837 end
838
839 end
840 opamt = j
841 end
842 else
843 toMinus = -160;
844 end
845 end
846
847 if selected_i then
848 for i = 0, #options do
849 local op = options[ i ];
850
851 if selected_i == i then
852 op.selected = not op.selected;
853 else
854 op.selected = false;
855 end;
856 end;
857 end;
858
859 mrel = false;
860end
861
862// Kill evil panels
863local function fix_esp()
864 MythX.RunString("function cam.Start3D() end function cam.End3D() end", false);
865end
866
867/*=====================
868 Menu option creation
869=======================*/
870
871addTab("Aimbot")
872addOption("Aimbot", "Aim Key", "key", true, "key", aimkey);
873addOption("Aimbot", "FOV", "Aim_FOV", 15, "slider", 0, 180);
874addOption("Aimbot", "Vertical offset", "Aim_Offset", 0, "slider", -12, 12);
875addOption("Aimbot", "Smooth speed", "Aim_SmoothSpeed", 0.05, "slider", 0.01, 0.18);
876addOption("Aimbot", "Friends list", "Aim_Friends", true, "button", friendsList);
877addOption("Aimbot", "Engine Predicition", "Aim_EnginePred", false);
878addOption("Aimbot", "No spread", "Aim_Nospread", false);
879addOption("Aimbot", "Hitscan", "Aim_Hitscan", false);
880addOption("Aimbot", "Smooth aim", "Aim_Smooth", false);
881addOption("Aimbot", "Auto fire", "Aim_AutoShoot", false);
882addOption("Aimbot", "Friendly fire", "Aim_FriendlyFire", false);
883
884addTab("ESP")
885addOption("ESP", "Max distance", "ESP_MaxDist", 15, "slider", 0, 8000);
886addOption("ESP", "Enabled", "ESP", true);
887addOption("ESP", "Box ESP", "ESP_Box", true);
888addOption("ESP", "Only show enemies", "ESP_Enemies", true);
889addOption("ESP", "Skeleton ESP", "ESP_HitBox", true);
890addOption("ESP", "Entity ESP", "EntESP", true);
891addOption("ESP", "Entity list", "EntESP_List", false, "button", entityList);
892
893addTab("Base helper")
894addOption("Base helper", "Set base", "baseHelper", false, "button", setBase);
895addOption("Base helper", "Base friends", "baseFriends", false, "button", baseList);
896addOption("Base helper", "Notify radius", "basingDist", 100, "slider", 1, 500);
897
898addTab("Misc")
899addOption("Misc", "Bunnyhop", "Bunnyhop", true);
900addOption("Misc", "Spectator list", "spectator_list", true);
901addOption("Misc", "Traitor detector", "traitor_detector", true);
902addOption("Misc", "Fix ESP", "fixESP", true, "button", fix_esp);
903addOption("Misc", "Reset traitors", "resettraitors", true, "button", MythX.reset_traitors);
904addOption("Misc", "Change name", "Namechange", true, "button", textEntry);
905addOption("Misc", "Steal a name", "nameSteal", true, "button", nameSteal);
906
907/*=====================
908 Aimbot functions
909=======================*/
910
911--// Distance function //--
912function math.Dist( x1, y1, x2, y2 )
913 local xd = x2-x1
914 local yd = y2-y1
915 return math.sqrt( xd*xd + yd*yd )
916end
917
918--// Entity distance function //--
919function MythX.Dist( p1, p2 )
920 return p1:GetPos():Distance( p2:GetPos() )
921end
922
923local function is_spec(ply)
924 return ply:GetTeam() == 1002;
925end
926
927--// Check if player is a valid target //--
928local function valid_target(ply)
929 if !ply then return false end
930 if ply:Health() <= 0 then return false end
931 if is_spec(ply) && !is_spec(LocalPlayer()) then return false end
932 if is_spec(LocalPlayer()) && !is_spec(ply) then return false end
933 if (ply:GetTeam() == LocalPlayer():GetTeam()) && !is_spec(ply) and !settings["Aim_FriendlyFire"] then return false end
934 if table.HasValue(aim_friends, ply:Nick()) then return false end
935
936 return true;
937end
938
939local bones = {
940 "ValveBiped.Bip01_Head1",
941 "ValveBiped.Bip01_Neck1",
942 "ValveBiped.Bip01_Spine4",
943 "ValveBiped.Bip01_Spine2",
944 "ValveBiped.Bip01_Spine",
945 "ValveBiped.Bip01_R_UpperArm",
946 "ValveBiped.Bip01_L_UpperArm",
947 "ValveBiped.Bip01_R_Forearm",
948 "ValveBiped.Bip01_L_Forearm",
949 "ValveBiped.Bip01_R_Hand",
950 "ValveBiped.Bip01_L_Hand",
951 "ValveBiped.Bip01_R_Calf",
952 "ValveBiped.Bip01_L_Calf",
953 "ValveBiped.Bip01_R_Foot",
954 "ValveBiped.Bip01_L_Foot"
955}
956
957local function get_bone(ply, num)
958 local hitbox = ply:GetBonePosition(num);
959
960 if hitbox && hitbox ~= zero_vec then
961 return hitbox;
962 end
963
964 return false;
965end
966
967local function optimal_bone(ply)
968 for k, v in next, bones do
969 local bone = get_bone(ply, ply:LookupBone(v));
970
971 if !bone then continue end;
972
973 if MythX.IsVisible(LocalPlayer():GetAbsEyePos(), bone, ply) then
974 return bone;
975 end
976 end
977 return nil;
978end
979
980--// Check if player is in FOV //--
981function in_fov(ent)
982 local fov = settings["Aim_FOV"]
983 if( fov != 180 ) then
984 local eyepos = ent:GetAbsEyePos()
985 if settings["Aim_Hitscan"] then
986 eyepos = optimal_bone(ent) or ent:GetAbsEyePos();
987 end
988 local lpang = LocalPlayer():GetAngles()
989 local ang = MythX.VectorAngles(eyepos - LocalPlayer():GetAbsEyePos())
990 local ady = math.abs( math.NormalizeAngle( lpang.y - ang.y ) )
991 local adp = math.abs( math.NormalizeAngle( lpang.p - ang.p ) )
992 if( ady > fov || adp > fov ) then return false end
993 end
994 return true
995end
996
997--// Angle distance function //--
998function angle_diff(ang, ang2, num)
999 local ady = math.abs( math.NormalizeAngle( ang.y - ang2.y ) )
1000 local adp = math.abs( math.NormalizeAngle( ang.p - ang2.p ) )
1001 if( ady > num || adp > num ) then return false end
1002 return true;
1003end
1004
1005local zero_ang = Angle(0, 0, 0);
1006local zero_vec = Vector(0, 0, 0);
1007
1008local function get_hitbox(ply, num)
1009
1010 local hitbox = MythX.CalculateAimVector(ply, num);
1011
1012 if hitbox && hitbox ~= zero_vec then
1013 return hitbox;
1014 end
1015
1016 return false;
1017end
1018
1019--// Return the current aimbot target //--
1020local function aimTarget()
1021 if not aimTarg then return end
1022 if aimTarg == 0 then return end
1023
1024 return aimTarg
1025end
1026
1027--// Get best aimbot target //--
1028local function getTarget()
1029 local p = LocalPlayer()
1030 local closest, dist = nil, 0
1031 local target = 0
1032
1033 for k, v in next, getPlayers() do
1034
1035 if k == MythX.GetLocalPlayerIndex() then continue end
1036
1037 if not MythX.IsVisible(p:GetAbsEyePos(), v:GetAbsEyePos(), v) && !settings["Aim_Hitscan"] then continue end
1038
1039 if not valid_target(v) then continue end
1040
1041 if not in_fov(v) then continue end
1042
1043 local _dist = math.Dist(MythX.ToScreen(v:GetAbsEyePos()).x, MythX.ToScreen(v:GetAbsEyePos()).y, ScrW()/2, ScrH()/2)
1044
1045 if (!closest or _dist < dist) then
1046 dist = _dist
1047 closest = v
1048 target = v
1049 end
1050 end
1051
1052 aimTarg = target
1053end
1054
1055/*=====================
1056 Aimbot
1057=======================*/
1058
1059--// Aimbot function //--
1060local function aim(cmd)
1061
1062 getTarget()
1063
1064 local v = aimTarget()
1065 local ply = LocalPlayer()
1066
1067 if aim_key >= 107 then
1068 if not (input.IsMouseDown(aim_key)) then return end
1069 else
1070 if not (input.IsKeyDown(aim_key)) then return end
1071 end
1072
1073 if not v then return end
1074
1075 local ang = optimal_bone(v);
1076
1077 if ang then
1078
1079 if settings["Aim_Offset"] ~= 0 then
1080 ang = ang - Vector(0,0,settings["Aim_Offset"])
1081 end
1082
1083 local angle = MythX.VectorAngles(ang - ply:GetAbsEyePos())
1084 local preang = angle;
1085
1086 if settings["Aim_Smooth"] then
1087 angle = LerpAngle(settings["Aim_SmoothSpeed"], cmd:GetViewAngles(), angle);
1088 end
1089
1090 if settings["Aim_Nospread"] && type(MythX.CompensateSpread()) == "Angle" then
1091 cmd:SetViewAngles(angle + MythX.CompensateSpread());
1092 else
1093 cmd:SetViewAngles(angle);
1094 end
1095
1096 if settings["Aim_AutoShoot"] then
1097 if settings["Aim_Smooth"] and !angle_diff(angle, preang, 0.5) then return end
1098 cmd:AutoShoot()
1099 end
1100 end
1101end
1102
1103/*=====================
1104 Spectator List
1105=======================*/
1106
1107local niggers, prefix = {}, {}
1108
1109local function draw_list()
1110 for k, v in next, getPlayers() do
1111 if !v then continue end
1112 if v == LocalPlayer() then continue end
1113
1114 local target = MythX.GetEntity(v:GetObserverTarget());
1115 local me = LocalPlayer():Nick();
1116
1117 if table.HasValue(niggers, v:Nick()) then
1118 if !target then
1119 table.RemoveByValue(niggers, v:Nick());
1120 else
1121 if target:ToPlayer() then
1122 if target:ToPlayer():Nick() ~= me then
1123 table.RemoveByValue(niggers, v:Nick());
1124 end
1125 else
1126 table.RemoveByValue(niggers, v:Nick());
1127 end
1128 end
1129 end
1130
1131 if target && target:ToPlayer() && !table.HasValue(niggers, v:Nick()) then
1132 if target:ToPlayer():Nick() == LocalPlayer():Nick() then
1133 table.sort(niggers)
1134 table.insert(niggers, v:Nick())
1135 end
1136 end
1137 end
1138
1139 if niggers[1] then
1140 SimpleTextOutlined( "Your being spectated by:", "Tahoma", 25, 25, Color(255,0,0), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255))
1141 end
1142
1143 for k, v in next, niggers do
1144 table.sort(niggers)
1145 SimpleTextOutlined(v, "Tahoma", 25, k * 12 + 25, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255))
1146 end
1147end
1148
1149/*=====================
1150 Entity ESP
1151=======================*/
1152
1153// Entity ESP
1154function MythX:EntESP()
1155 if not settings["EntESP"] then return end
1156
1157 for k, v in next, getEnts() do
1158 if !v or v == nil then continue end
1159
1160 if table.HasValue(MythX.entlist, v:GetClass()) or table.HasValue(MythX.entlist, string.sub(v:GetClass(), 11)) or table.HasValue(MythX.entlist, string.sub(v:GetClass(), 12)) then
1161 if v:GetAbsPos():Distance(LocalPlayer():GetAbsPos()) > tonumber(settings["ESP_MaxDist"]) then continue end
1162 local pos, text = MythX.ToScreen(v:GetAbsPos()), v:GetClass()
1163 if string.sub(v:GetClass(), 0, 11) == "weapon_ttt_" then
1164 text = string.sub(v:GetClass(), 12)
1165 elseif string.sub(v:GetClass(), 0, 10) == "weapon_zm_" then
1166 text = string.sub(v:GetClass(), 11)
1167 end
1168 SimpleTextOutlined(text, "Tahoma", pos.x, pos.y + 16, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255))
1169 end
1170 end
1171end
1172
1173/*=====================
1174 ESP & Drawing
1175=======================*/
1176
1177local function GetAimVector()
1178 return MythX.GetViewAngles():Forward()
1179end
1180
1181function MythX.EyeTrace()
1182 local me = LocalPlayer();
1183 local eyepos = me:GetAbsEyePos();
1184 local endvec = eyepos + GetAimVector() * 8192;
1185 return MythX.GetEyeTrace(eyepos, endvec);
1186end
1187
1188local spine = {"Head1", "Neck1", "Spine4", "Spine2", "Spine1", "Spine"};
1189local arm1 = {"R_Hand", "R_Forearm", "R_UpperArm", "R_Clavicle"};
1190local arm2 = {"L_Hand", "L_Forearm", "L_UpperArm", "L_Clavicle"};
1191local leg1 = {"R_Thigh", "R_Calf", "R_Foot", "R_Toe0"};
1192local leg2 = {"L_Thigh", "L_Calf", "L_Foot", "L_Toe0"};
1193
1194local function DrawBone(ply, b1, b2)
1195 if !ply or !b1 or !b2 then return end
1196
1197 local name1, name2 = "ValveBiped.Bip01_"..b1, "ValveBiped.Bip01_"..b2;
1198 local bone1, bone2 = ply:GetBonePosition(ply:LookupBone(name1)), ply:GetBonePosition(ply:LookupBone(name2));
1199
1200 if !bone1 or !bone2 then return end
1201 if bone1 == -1 or bone2 == -1 then return end
1202
1203 local pos1, pos2 = MythX.ToScreen(bone1), MythX.ToScreen(bone2);
1204
1205 if pos1 && pos2 then
1206 surface.SetDrawColor(255,255,255);
1207 surface.DrawLine(pos1.x, pos1.y, pos2.x, pos2.y);
1208 end
1209end
1210
1211local function bone_esp(ply)
1212 for i = 1, 6 do -- Spine
1213 DrawBone(ply, spine[i], spine[i + 1]);
1214 end
1215
1216 for i = 1, 4 do -- Limbs
1217 DrawBone(ply, arm1[i], arm1[i + 1]);
1218 DrawBone(ply, arm2[i], arm2[i + 1]);
1219 DrawBone(ply, leg1[i], leg1[i + 1]);
1220 DrawBone(ply, leg2[i], leg2[i + 1]);
1221 end
1222
1223 -- Joints
1224 DrawBone(ply, arm1[4], spine[2]);
1225 DrawBone(ply, arm2[4], spine[2]);
1226 DrawBone(ply, leg1[1], spine[6]);
1227 DrawBone(ply, leg2[1], spine[6]);
1228end
1229
1230--// Master drawing function //--
1231local function drawCheat()
1232
1233 if notifyOn then
1234 surface.SetFont( "TahomaS" )
1235
1236 local textW, textH = surface.GetTextSize( nmsg )
1237 local w, h = 150, textH + 8
1238
1239 if textW > w then
1240 w = textW + 8
1241 end
1242
1243 local nX, nY = ScrW() / 2 - (w / 2), 200 - (h / 2)
1244
1245 RoundedBox(0, nX, nY - 25, w, 25, menuColor)
1246 RoundedBox(0, nX, nY, w, h, Color(40,40,40))
1247 drawSprite(nicon, nX + 5, nY - 25 + 5, 16, 16)
1248 SimpleTextOutlined(nlabel, "TahomaS", nX + 25, nY - 25 + 13, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
1249 SimpleTextOutlined(nmsg, "TahomaS", nX + 5, nY + 9.5, ncolor, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
1250 end
1251
1252 draw()
1253
1254 local me = LocalPlayer();
1255
1256 if IsInGame() then
1257
1258 if settings["spectator_list"] then
1259 draw_list();
1260 end
1261
1262 if settings["EntESP"] then
1263 MythX:EntESP()
1264 end
1265
1266 MythX:baseHelper()
1267
1268 if settings["ESP"] then
1269 for _, ply in next, getPlayers() do
1270
1271 if ply == me then continue end
1272
1273 if settings["ESP_Enemies"] && (ply:GetTeam() == LocalPlayer():GetTeam()) && !is_spec(ply) then continue end
1274
1275 if is_spec(ply) && !is_spec(LocalPlayer()) then continue end
1276
1277 if ply:GetAbsPos():Distance(LocalPlayer():GetAbsPos()) < tonumber(settings["ESP_MaxDist"]) then
1278
1279 if ply:Health() <= 0 then continue end
1280
1281 local col = Color(0,255,0);
1282
1283 if ply == aimTarget() then
1284 col = Color( 0, 157, 255 );
1285 end
1286
1287 if !settings["Aim_Hitscan"] then
1288 if not MythX.IsVisible(LocalPlayer():GetAbsEyePos(), ply:GetAbsEyePos(), ply) then
1289 col = Color(255,0,76);
1290 end
1291 else
1292 local bone = optimal_bone(ply);
1293 if bone then
1294 if not MythX.IsVisible(LocalPlayer():GetAbsEyePos(), bone, ply) then
1295 col = Color(255,0,76);
1296 end
1297 else
1298 col = Color(255,0,76);
1299 end
1300 end
1301
1302 local min, max, pos = ply:OBBMins(), ply:OBBMaxs(), ply:GetAbsPos()
1303 local top, bottom = MythX.ToScreen(pos + Vector(0, 0, max.z)), MythX.ToScreen(pos - Vector(0, 0, 15))
1304 local middle = bottom.y - top.y
1305 local width = middle / 2.5
1306
1307 if settings["ESP_Box"] then
1308 local pos2 = pos + Vector(0, 0, max.z);
1309 local pos = MythX.ToScreen(pos);
1310 local pos2 = MythX.ToScreen(pos2);
1311 local h = pos.y - pos2.y;
1312 local w = h / 2;
1313
1314 surface.SetDrawColor(col);
1315 surface.DrawOutlinedRect(pos.x - w / 2, pos.y - h, w, h);
1316 surface.SetDrawColor(Color(0,0,0));
1317 surface.DrawOutlinedRect(pos.x - w / 2 - 1, pos.y - h - 1, w + 2, h + 2);
1318 surface.DrawOutlinedRect(pos.x - w / 2 + 1, pos.y - h + 1, w - 2, h - 2);
1319
1320 surface.SetFont("visuals");
1321 surface.SetTextColor(255, 255, 255);
1322
1323 local col = Color(( 100 - ply:Health() ) * 2.55, ply:Health() * 2, 0, 255);
1324 local hp = ply:Health() * h / 100;
1325 if(hp > h) then hp = h; end
1326 local diff = h - hp;
1327 surface.SetDrawColor(0, 0, 0, 255);
1328 surface.DrawRect(pos.x - w / 2 - 6, pos.y - h - 1, 4, h + 2);
1329 surface.SetDrawColor(col);
1330 surface.DrawRect(pos.x - w / 2 - 5, pos.y - h + diff, 2, hp);
1331
1332 if table.HasValue(traitors, ply) then
1333 SimpleTextOutlined("-TRAITOR-", "visuals", pos.x, pos.y + 10, Color(255,0,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
1334 end
1335
1336 local col1 = Color(255,255,255)
1337 SimpleTextOutlined(ply:Nick(), "visuals", pos.x, pos.y - h - 1 - 7, col1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255));
1338 end
1339
1340 if settings["ESP_HitBox"] then
1341 bone_esp(ply);
1342 end
1343 end
1344 end
1345 end
1346 end
1347end
1348
1349/*=====================
1350 Hooking
1351=======================*/
1352
1353local Hooks = {}
1354
1355--// Hook called function //--
1356function MythX.OnHookCall(hookname, a1, a2, a3, a4, a5, a6, a7, a8, a9)
1357
1358 MythX.SetHookFunc(MythX.OnHookCall)
1359
1360 if(!hookname) then
1361 return
1362 end
1363
1364 local func = MythX.HookTable[hookname]
1365
1366 if(!func) then
1367 print("!FUNC: " .. hookname)
1368 return
1369 end
1370
1371 local succ, reta, retb, retc, retd, rete, retf, retg = pcall(func, a1, a2, a3, a4, a5, a6, a7, a8, a9)
1372 if(not succ) then
1373 print("!HOOK CALL: " .. reta)
1374 return
1375 end
1376
1377 return reta, retb, retc, retd, rete, retf, retg
1378
1379end
1380
1381--// Return hook function //--
1382local function hook_func(hooknamescrub, ...)
1383 if(Hooks[hooknamescrub]) then
1384 return Hooks[hooknamescrub](...)
1385 end
1386
1387 return nil
1388end
1389MythX.SetHookFunc(hook_func, Vector, Angle)
1390
1391
1392--// Create move hook //--
1393local function OnCreateMove(cmd)
1394 if settings["Bunnyhop"] then
1395 MythX.Bunnyhop();
1396 end
1397
1398 if settings["Aim_EnginePred"] then
1399 MythX.EnginePred();
1400 end
1401
1402 aim(cmd)
1403
1404 if settings["traitor_detector"] then
1405 detect_traitors()
1406 end
1407end
1408
1409--// Hook creation //--
1410Hooks["OnCreateMove"] = OnCreateMove
1411hook.GetTable()["DrawOverlay"]["CaptureFrames"] = drawCheat;
1412
1413--// Run code in menu state //--
1414concommand.Add("menu_run", function(p,c,a,s)
1415 MythX.RunString(s, true)
1416end)
1417
1418concommand.Add("menu_openscript", function(p,c,a,s)
1419 MythX.OpenScript(s, true)
1420end)
1421
1422concommand.Add("menu_openclient", function(p,c,a,s)
1423 MythX.OpenScript(s, false)
1424end)
1425
1426--// Finished loading! //--
1427
1428MsgC( Color( 0, 255, 0 ), "MythX has successfully loaded!" )
1429notify(MythX.Mats.info, "Welcome!", "MythX v"..MythX.Version().." has loaded successfully!", 5, false, Color(0,255,0))
1430
1431end) -- lua stack leak prevention]])
1432 end)