· 6 years ago · Feb 13, 2020, 12:50 AM
1_G.SelectedColor = Color3.fromRGB(255,255,255)
2assert(Drawing, 'exploit not supported')
3
4local UserInputService = game:GetService'UserInputService';
5local HttpService = game:GetService'HttpService';
6local GUIService = game:GetService'GuiService';
7local RunService = game:GetService'RunService';
8local Players = game:GetService'Players';
9local LocalPlayer = Players.LocalPlayer;
10local Camera = workspace.CurrentCamera
11local Mouse = LocalPlayer:GetMouse();
12local Menu = {};
13local MouseHeld = false;
14local LastRefresh = 0;
15local OptionsFile = 'IC3_ESP_SETTINGS.dat';
16local Binding = false;
17local BindedKey = nil;
18local OIndex = 0;
19local LineBox = {};
20local UIButtons = {};
21local Sliders = {};
22local Dragging = false;
23local DraggingUI = false;
24local DragOffset = Vector2.new();
25local DraggingWhat = nil;
26local OldData = {};
27local IgnoreList = {};
28local Red = Color3.new(1, 0, 0);
29local Green = Color3.new(0, 1, 0);
30local MenuLoaded = false;
31
32shared.MenuDrawingData = shared.MenuDrawingData or { Instances = {} };
33shared.PlayerData = shared.PlayerData or {};
34shared.RSName = shared.RSName or ('UnnamedESP_by_ic3-' .. HttpService:GenerateGUID(false));
35
36local GetDataName = shared.RSName .. '-GetData';
37local UpdateName = shared.RSName .. '-Update';
38
39local Debounce = setmetatable({}, {
40__index = function(t, i)
41return rawget(t, i) or false
42end;
43});
44
45pcall(function() shared.InputBeganCon:disconnect() end);
46pcall(function() shared.InputEndedCon:disconnect() end);
47
48function GetMouseLocation()
49return UserInputService:GetMouseLocation();
50end
51
52function MouseHoveringOver(Values)
53local X1, Y1, X2, Y2 = Values[1], Values[2], Values[3], Values[4]
54local MLocation = GetMouseLocation();
55return (MLocation.x >= X1 and MLocation.x <= (X1 + (X2 - X1))) and (MLocation.y >= Y1 and MLocation.y <= (Y1 + (Y2 - Y1)));
56end
57
58function GetTableData(t) -- basically table.foreach i dont even know why i made this
59if typeof(t) ~= 'table' then return end
60return setmetatable(t, {
61__call = function(t, func)
62if typeof(func) ~= 'function' then return end;
63for i, v in pairs(t) do
64pcall(func, i, v);
65end
66end;
67});
68end
69local function Format(format, ...)
70return string.format(format, ...);
71end
72function CalculateValue(Min, Max, Percent)
73return Min + math.floor(((Max - Min) * Percent) + .5);
74end
75
76local Options = setmetatable({}, {
77__call = function(t, ...)
78local Arguments = {...};
79local Name = Arguments[1];
80OIndex = OIndex + 1; -- (typeof(Arguments[3]) == 'boolean' and 1 or 0);
81rawset(t, Name, setmetatable({
82Name = Arguments[1];
83Text = Arguments[2];
84Value = Arguments[3];
85DefaultValue = Arguments[3];
86AllArgs = Arguments;
87Index = OIndex;
88}, {
89__call = function(t, v)
90if typeof(t.Value) == 'function' then
91t.Value();
92elseif typeof(t.Value) == 'EnumItem' then
93local BT = Menu:GetInstance(Format('%s_BindText', t.Name));
94Binding = true;
95local Val = 0
96while Binding do
97wait();
98Val = (Val + 1) % 17;
99BT.Text = Val <= 8 and '|' or '';
100end
101t.Value = BindedKey;
102BT.Text = tostring(t.Value):match'%w+%.%w+%.(.+)';
103BT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - BT.TextBounds.X - 20, -10);
104else
105local NewValue = v;
106if NewValue == nil then NewValue = not t.Value; end
107rawset(t, 'Value', NewValue);
108if Arguments[2] ~= nil then
109if typeof(Arguments[3]) == 'number' then
110local AMT = Menu:GetInstance(Format('%s_AmountText', t.Name));
111AMT.Text = tostring(t.Value);
112AMT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - AMT.TextBounds.X - 10, -10);
113else
114local Inner = Menu:GetInstance(Format('%s_InnerCircle', t.Name));
115Inner.Visible = t.Value;
116end
117end
118end
119end;
120}));
121end;
122})
123
124function Load()
125local _, Result = pcall(readfile, OptionsFile);
126if _ then -- extremely ugly code yea i know but i dont care p.s. i hate pcall
127local _, Table = pcall(HttpService.JSONDecode, HttpService, Result);
128if _ then
129for i, v in pairs(Table) do
130if Options[i] ~= nil and Options[i].Value ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
131Options[i].Value = v.Value;
132pcall(Options[i], v.Value);
133end
134end
135end
136end
137end
138
139Options('Enabled', 'ESP Enabled', true);
140Options('ShowTeam', 'Show Team', false);
141Options('ShowName', 'Show Names', false);
142Options('ShowDistance', 'Show Distance', false);
143Options('ShowHealth', 'Show Health', false);
144Options('ShowBoxes', 'Show Boxes', false);
145Options('ShowTracers', 'Show Tracers', false);
146Options('ShowDot', 'Show Head Dot', false);
147Options('VisCheck', 'Visibility Check', false);
148Options('Crosshair', 'Crosshair', false);
149Options('TextOutline', 'Text Outline', false);
150Options('TextSize', 'Text Size', syn and 18 or 14, 10, 24); -- cuz synapse fonts look weird???
151Options('MaxDistance', 'Max Distance', 2500, 100, 5000);
152Options('RefreshRate', 'Refresh Rate (ms)', 5, 1, 200);
153Options('MenuKey', 'Menu Key', Enum.KeyCode.F4, 1);
154Options('ResetSettings', 'Reset Settings', function()
155for i, v in pairs(Options) do
156if Options[i] ~= nil and Options[i].Value ~= nil and Options[i].Text ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
157Options[i](Options[i].DefaultValue);
158end
159end
160end, 4);
161Options('LoadSettings', 'Load Settings', Load, 3);
162Options('SaveSettings', 'Save Settings', function()
163writefile(OptionsFile, HttpService:JSONEncode(Options));
164end, 2)
165-- Options.SaveSettings.Value();
166
167Load();
168
169Options('MenuOpen', nil, false);
170
171local function Set(t, i, v)
172t[i] = v;
173end
174local function Combine(...)
175local Output = {};
176for i, v in pairs{...} do
177if typeof(v) == 'table' then
178table.foreach(v, function(i, v)
179Output[i] = v;
180end)
181end
182end
183return Output
184end
185function IsStringEmpty(String)
186if type(String) == 'string' then
187return String:match'^%s+$' ~= nil or #String == 0 or String == '' or false;
188end
189return false
190end
191
192function NewDrawing(InstanceName)
193local Instance = Drawing.new(InstanceName);
194return (function(Properties)
195for i, v in pairs(Properties) do
196pcall(Set, Instance, i, v);
197end
198return Instance;
199end)
200end
201
202pcall(Set, v, 'Visible', false);
203
204function Menu:AddMenuInstace(Name, Instance)
205if shared.MenuDrawingData.Instances[Name] ~= nil then
206shared.MenuDrawingData.Instances[Name]:Remove();
207end
208shared.MenuDrawingData.Instances[Name] = Instance;
209return Instance;
210end
211function Menu:UpdateMenuInstance(Name)
212local Instance = shared.MenuDrawingData.Instances[Name];
213if Instance ~= nil then
214return (function(Properties)
215for i, v in pairs(Properties) do
216-- print(Format('%s %s -> %s', Name, tostring(i), tostring(v)));
217pcall(Set, Instance, i, v);
218end
219return Instance;
220end)
221end
222end
223function Menu:GetInstance(Name)
224return shared.MenuDrawingData.Instances[Name];
225end
226
227function LineBox:Create(Properties)
228local Box = { Visible = true }; -- prevent errors not really though dont worry bout the Visible = true thing
229
230local Properties = Combine({
231Transparency = 1;
232Thickness = 0.2;
233Visible = true;
234}, Properties);
235
236Box['TopLeft'] = NewDrawing'Line'(Properties);
237Box['TopRight'] = NewDrawing'Line'(Properties);
238Box['BottomLeft'] = NewDrawing'Line'(Properties);
239Box['BottomRight'] = NewDrawing'Line'(Properties);
240
241function Box:Update(CF, Size, Color, Properties)
242if not CF or not Size then return end
243
244local TLPos, Visible1 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, Size.Y, 0)).p);
245local TRPos, Visible2 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, Size.Y, 0)).p);
246local BLPos, Visible3 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, -Size.Y, 0)).p);
247local BRPos, Visible4 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, -Size.Y, 0)).p);
248-- ## BEGIN UGLY CODE
249if Visible1 then
250Box['TopLeft'].Visible = true;
251Box['TopLeft'].Color = Color;
252Box['TopLeft'].From = Vector2.new(TLPos.X, TLPos.Y);
253Box['TopLeft'].To = Vector2.new(TRPos.X, TRPos.Y);
254Box['TopLeft'].Thickness = 0.2;
255Box['TopLeft'].Thickness = 0.2;
256Box['TopLeft'].Thickness = 0.2;
257Box['TopLeft'].Thickness = 0.2;
258else
259Box['TopLeft'].Visible = false;
260end
261if Visible2 then
262Box['TopRight'].Visible = true;
263Box['TopRight'].Color = Color;
264Box['TopRight'].From = Vector2.new(TRPos.X, TRPos.Y);
265Box['TopRight'].To = Vector2.new(BRPos.X, BRPos.Y);
266Box['TopRight'].Thickness = 0.2;
267Box['TopRight'].Thickness = 0.2;
268Box['TopRight'].Thickness = 0.2;
269Box['TopRight'].Thickness = 0.2;
270else
271Box['TopRight'].Visible = false;
272end
273if Visible3 then
274Box['BottomLeft'].Visible = true;
275Box['BottomLeft'].Color = Color;
276Box['BottomLeft'].From = Vector2.new(BLPos.X, BLPos.Y);
277Box['BottomLeft'].To = Vector2.new(TLPos.X, TLPos.Y);
278Box['BottomLeft'].Thickness = 0.2;
279Box['BottomLeft'].Thickness = 0.2;
280Box['BottomLeft'].Thickness = 0.2;
281Box['BottomLeft'].Thickness = 0.2;
282else
283Box['BottomLeft'].Visible = false;
284end
285if Visible4 then
286Box['BottomRight'].Visible = true;
287Box['BottomRight'].Color = Color;
288Box['BottomRight'].From = Vector2.new(BRPos.X, BRPos.Y);
289Box['BottomRight'].To = Vector2.new(BLPos.X, BLPos.Y);
290Box['BottomRight'].Thickness = 0.2;
291Box['BottomRight'].Thickness = 0.2;
292Box['BottomRight'].Thickness = 0.2;
293Box['BottomRight'].Thickness = 0.2;
294else
295Box['BottomRight'].Visible = false;
296end
297-- ## END UGLY CODE
298if Properties then
299GetTableData(Properties)(function(i, v)
300pcall(Set, Box['TopLeft'], i, v);
301pcall(Set, Box['TopRight'], i, v);
302pcall(Set, Box['BottomLeft'], i, v);
303pcall(Set, Box['BottomRight'], i, v);
304end)
305end
306end
307function Box:SetVisible(bool)
308pcall(Set, Box['TopLeft'], 'Visible', bool);
309pcall(Set, Box['TopRight'], 'Visible', bool);
310pcall(Set, Box['BottomLeft'], 'Visible', bool);
311pcall(Set, Box['BottomRight'], 'Visible', bool);
312end
313function Box:Remove()
314self:SetVisible(false);
315Box['TopLeft']:Remove();
316Box['TopRight']:Remove();
317Box['BottomLeft']:Remove();
318Box['BottomRight']:Remove();
319end
320
321return Box;
322end
323
324function CreateMenu(NewPosition) -- Create Menu
325local function FromHex(HEX)
326HEX = HEX:gsub('#', '');
327return Color3.fromRGB(tonumber('0x' .. HEX:sub(1, 2)), tonumber('0x' .. HEX:sub(3, 4)), tonumber('0x' .. HEX:sub(5, 6)));
328end
329
330local Colors = {
331Primary = {
332Main = FromHex'424242';
333Light = FromHex'6d6d6d';
334Dark = FromHex'1b1b1b';
335};
336Secondary = {
337Main = FromHex'e0e0e0';
338Light = FromHex'ffffff';
339Dark = FromHex'aeaeae';
340};
341};
342
343MenuLoaded = false;
344
345GetTableData(UIButtons)(function(i, v)
346v.Instance.Visible = false;
347v.Instance:Remove();
348end)
349GetTableData(Sliders)(function(i, v)
350v.Instance.Visible = false;
351v.Instance:Remove();
352end)
353
354UIButtons = {};
355Sliders = {};
356
357local BaseSize = Vector2.new(300, 580);
358local BasePosition = NewPosition or Vector2.new(Camera.ViewportSize.X / 8 - (BaseSize.X / 2), Camera.ViewportSize.Y / 2 - (BaseSize.Y / 2));
359
360Menu:AddMenuInstace('CrosshairX', NewDrawing'Line'{
361Visible = false;
362Color = Color3.new(0, 1, 0);
363Transparency = 1;
364Thickness = 1;
365});
366Menu:AddMenuInstace('CrosshairY', NewDrawing'Line'{
367Visible = false;
368Color = Color3.new(0, 1, 0);
369Transparency = 1;
370Thickness = 1;
371});
372
373delay(.025, function() -- since zindex doesnt exist
374Menu:AddMenuInstace('Main', NewDrawing'Square'{
375Size = BaseSize;
376Position = BasePosition;
377Filled = false;
378Color = Colors.Primary.Main;
379Thickness = 3;
380Visible = true;
381});
382end);
383Menu:AddMenuInstace('TopBar', NewDrawing'Square'{
384Position = BasePosition;
385Size = Vector2.new(BaseSize.X, 25);
386Color = Colors.Primary.Dark;
387Filled = true;
388Visible = true;
389});
390Menu:AddMenuInstace('TopBarTwo', NewDrawing'Square'{
391Position = BasePosition + Vector2.new(0, 25);
392Size = Vector2.new(BaseSize.X, 60);
393Color = Colors.Primary.Main;
394Filled = true;
395Visible = true;
396});
397Menu:AddMenuInstace('TopBarText', NewDrawing'Text'{
398Size = 25;
399Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(25, 15);
400Text = 'Unnamed ESP';
401Color = Colors.Secondary.Light;
402Visible = true;
403});
404Menu:AddMenuInstace('TopBarTextBR', NewDrawing'Text'{
405Size = 15;
406Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(BaseSize.X - 65, 40);
407Text = 'by ic3w0lf';
408Color = Colors.Secondary.Dark;
409Visible = true;
410});
411Menu:AddMenuInstace('Filling', NewDrawing'Square'{
412Size = BaseSize - Vector2.new(0, 85);
413Position = BasePosition + Vector2.new(0, 85);
414Filled = true;
415Color = Colors.Secondary.Main;
416Transparency= .5;
417Visible = true;
418});
419
420local CPos = 0;
421
422GetTableData(Options)(function(i, v)
423if typeof(v.Value) == 'boolean' and not IsStringEmpty(v.Text) and v.Text ~= nil then
424CPos = CPos + 25;
425local BaseSize = Vector2.new(BaseSize.X, 30);
426local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(30, v.Index * 25 - 10);
427UIButtons[#UIButtons + 1] = {
428Option = v;
429Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
430Position = BasePosition - Vector2.new(30, 15);
431Size = BaseSize;
432Visible = false;
433});
434};
435Menu:AddMenuInstace(Format('%s_OuterCircle', v.Name), NewDrawing'Circle'{
436Radius = 10;
437Position = BasePosition;
438Color = Colors.Secondary.Light;
439Filled = true;
440Visible = true;
441});
442Menu:AddMenuInstace(Format('%s_InnerCircle', v.Name), NewDrawing'Circle'{
443Radius = 7;
444Position = BasePosition;
445Color = Colors.Secondary.Dark;
446Filled = true;
447Visible = v.Value;
448});
449Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
450Text = v.Text;
451Size = 20;
452Position = BasePosition + Vector2.new(20, -10);
453Visible = true;
454Color = Colors.Primary.Dark;
455});
456end
457end)
458GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
459if typeof(v.Value) == 'number' then
460CPos = CPos + 25;
461
462local BaseSize = Vector2.new(BaseSize.X, 30);
463local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
464
465local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
466Text = v.Text;
467Size = 20;
468Position = BasePosition + Vector2.new(20, -10);
469Visible = true;
470Color = Colors.Primary.Dark;
471});
472local AMT = Menu:AddMenuInstace(Format('%s_AmountText', v.Name), NewDrawing'Text'{
473Text = tostring(v.Value);
474Size = 20;
475Position = BasePosition;
476Visible = true;
477Color = Colors.Primary.Dark;
478});
479local Line = Menu:AddMenuInstace(Format('%s_SliderLine', v.Name), NewDrawing'Line'{
480Transparency = 1;
481Color = Colors.Primary.Dark;
482Thickness = 3;
483Visible = true;
484From = BasePosition + Vector2.new(20, 20);
485To = BasePosition + Vector2.new(BaseSize.X - 10, 20);
486});
487CPos = CPos + 10;
488local Slider = Menu:AddMenuInstace(Format('%s_Slider', v.Name), NewDrawing'Circle'{
489Visible = true;
490Filled = true;
491Radius = 6;
492Color = Colors.Secondary.Dark;
493Position = BasePosition + Vector2.new(35, 20);
494})
495
496local CSlider = {Slider = Slider; Line = Line; Min = v.AllArgs[4]; Max = v.AllArgs[5]; Option = v};
497Sliders[#Sliders + 1] = CSlider;
498
499-- local Percent = (v.Value / CSlider.Max) * 100;
500-- local Size = math.abs(Line.From.X - Line.To.X);
501-- local Value = Size * (Percent / 100); -- this shit's inaccurate but fuck it i'm not even gonna bother fixing it
502
503Slider.Position = BasePosition + Vector2.new(40, 20);
504
505v.BaseSize = BaseSize;
506v.BasePosition = BasePosition;
507AMT.Position = BasePosition + Vector2.new(BaseSize.X - AMT.TextBounds.X - 10, -10)
508end
509end)
510GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
511if typeof(v.Value) == 'EnumItem' then
512CPos = CPos + 30;
513
514local BaseSize = Vector2.new(BaseSize.X, 30);
515local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
516
517UIButtons[#UIButtons + 1] = {
518Option = v;
519Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
520Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
521Visible = true;
522Transparency= .5;
523Position = BasePosition + Vector2.new(15, -10);
524Color = Colors.Secondary.Light;
525Filled = true;
526});
527};
528local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
529Text = v.Text;
530Size = 20;
531Position = BasePosition + Vector2.new(20, -10);
532Visible = true;
533Color = Colors.Primary.Dark;
534});
535local BindText = Menu:AddMenuInstace(Format('%s_BindText', v.Name), NewDrawing'Text'{
536Text = tostring(v.Value):match'%w+%.%w+%.(.+)';
537Size = 20;
538Position = BasePosition;
539Visible = true;
540Color = Colors.Primary.Dark;
541});
542
543Options[i].BaseSize = BaseSize;
544Options[i].BasePosition = BasePosition;
545BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 20, -10);
546end
547end)
548GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
549if typeof(v.Value) == 'function' then
550local BaseSize = Vector2.new(BaseSize.X, 30);
551local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos + (25 * v.AllArgs[4]) - 35);
552
553UIButtons[#UIButtons + 1] = {
554Option = v;
555Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
556Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
557Visible = true;
558Transparency= .5;
559Position = BasePosition + Vector2.new(15, -10);
560Color = Colors.Secondary.Light;
561Filled = true;
562});
563};
564local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
565Text = v.Text;
566Size = 20;
567Position = BasePosition + Vector2.new(20, -10);
568Visible = true;
569Color = Colors.Primary.Dark;
570});
571
572-- BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 10, -10);
573end
574end)
575
576delay(.1, function()
577MenuLoaded = true;
578end);
579
580-- this has to be at the bottom cuz proto drawing api doesnt have zindex :triumph:
581Menu:AddMenuInstace('Cursor1', NewDrawing'Line'{
582Visible = false;
583Color = Color3.new(1, 0, 0);
584Transparency = 1;
585Thickness = 2;
586});
587Menu:AddMenuInstace('Cursor2', NewDrawing'Line'{
588Visible = false;
589Color = Color3.new(1, 0, 0);
590Transparency = 1;
591Thickness = 2;
592});
593Menu:AddMenuInstace('Cursor3', NewDrawing'Line'{
594Visible = false;
595Color = Color3.new(1, 0, 0);
596Transparency = 1;
597Thickness = 2;
598});
599end
600
601--CreateMenu();
602
603shared.InputBeganCon = UserInputService.InputBegan:connect(function(input)
604if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
605MouseHeld = true;
606local Bar = Menu:GetInstance'TopBar';
607local Values = {
608Bar.Position.X;
609Bar.Position.Y;
610Bar.Position.X + Bar.Size.X;
611Bar.Position.Y + Bar.Size.Y;
612}
613if MouseHoveringOver(Values) and not syn then -- disable dragging for synapse cuz idk why it breaks
614DraggingUI = true;
615DragOffset = Menu:GetInstance'Main'.Position - GetMouseLocation();
616else
617for i, v in pairs(Sliders) do
618local Values = {
619v.Line.From.X - (v.Slider.Radius);
620v.Line.From.Y - (v.Slider.Radius);
621v.Line.To.X + (v.Slider.Radius);
622v.Line.To.Y + (v.Slider.Radius);
623};
624if MouseHoveringOver(Values) then
625DraggingWhat = v;
626Dragging = true;
627break
628end
629end
630end
631end
632end)
633shared.InputEndedCon = UserInputService.InputEnded:connect(function(input)
634if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
635MouseHeld = false;
636for i, v in pairs(UIButtons) do
637local Values = {
638v.Instance.Position.X;
639v.Instance.Position.Y;
640v.Instance.Position.X + v.Instance.Size.X;
641v.Instance.Position.Y + v.Instance.Size.Y;
642};
643if MouseHoveringOver(Values) then
644v.Option();
645break -- prevent clicking 2 options
646end
647end
648elseif input.UserInputType.Name == 'Keyboard' then
649if Binding then
650BindedKey = input.KeyCode;
651Binding = false;
652elseif input.KeyCode == Options.MenuKey.Value or (input.KeyCode == Enum.KeyCode.Home and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl)) then
653Options.MenuOpen();
654end
655end
656end)
657
658function ToggleMenu()
659
660GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
661if v.Visible == true then
662 OldData[v] = true;
663 pcall(Set, v, 'Visible', false);
664end
665end)
666end
667ToggleMenu()
668function CheckRay(Player, Distance, Position, Unit)
669local Pass = true;
670
671if Distance > 999 then return false; end
672
673local _Ray = Ray.new(Position, Unit * Distance);
674
675local List = {LocalPlayer.Character, Camera, Mouse.TargetFilter};
676
677for i,v in pairs(IgnoreList) do table.insert(List, v); end;
678
679local Hit = workspace:FindPartOnRayWithIgnoreList(_Ray, List);
680if Hit and not Hit:IsDescendantOf(Player.Character) then
681Pass = false;
682if Hit.Transparency >= .3 or not Hit.CanCollide and Hit.ClassName ~= Terrain then -- Detect invisible walls
683IgnoreList[#IgnoreList + 1] = Hit;
684end
685end
686
687return Pass;
688end
689
690function CheckPlayer(Player)
691if not Options.Enabled.Value then return false end
692
693local Pass = true;
694local Distance = 0;
695
696if Player ~= LocalPlayer and Player.Character then
697if not Options.ShowTeam.Value and Player.TeamColor == LocalPlayer.TeamColor then
698Pass = false;
699end
700
701local Head = Player.Character:FindFirstChild'Head';
702
703if Pass and Player.Character and Head then
704Distance = (Camera.CFrame.p - Head.Position).magnitude;
705if Options.VisCheck.Value then
706Pass = CheckRay(Player, Distance, Camera.CFrame.p, (Head.Position - Camera.CFrame.p).unit);
707end
708if Distance > Options.MaxDistance.Value then
709Pass = false;
710end
711end
712else
713Pass = false;
714end
715
716return Pass, Distance;
717end
718
719function UpdatePlayerData()
720if (tick() - LastRefresh) > (Options.RefreshRate.Value / 1000) then
721LastRefresh = tick();
722for i, v in pairs(Players:GetPlayers()) do
723local Data = shared.PlayerData[v.Name] or { Instances = {} };
724
725Data.Instances['Box'] = Data.Instances['Box'] or LineBox:Create{Thickness = 3};
726Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
727Transparency = 1;
728Thickness = 2;
729}
730Data.Instances['HeadDot'] = Data.Instances['HeadDot'] or NewDrawing'Circle'{
731Filled = true;
732NumSides = 30;
733}
734Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
735Size = 10;
736Center = true;
737Outline = Options.TextOutline.Value;
738Visible = true;
739};
740Data.Instances['DistanceHealthTag'] = Data.Instances['DistanceHealthTag'] or NewDrawing'Text'{
741Size = Options.TextSize.Value - 1;
742Center = true;
743Outline = Options.TextOutline.Value;
744Visible = true;
745};
746
747local NameTag = Data.Instances['NameTag'];
748local DistanceTag = Data.Instances['DistanceHealthTag'];
749local Tracer = Data.Instances['Tracer'];
750local HeadDot = Data.Instances['HeadDot'];
751local Box = Data.Instances['Box'];
752
753local Pass, Distance = CheckPlayer(v);
754
755if Pass and v.Character then
756Data.LastUpdate = tick();
757local Humanoid = v.Character:FindFirstChildOfClass'Humanoid';
758local Head = v.Character:FindFirstChild'Head';
759local HumanoidRootPart = v.Character:FindFirstChild'HumanoidRootPart';
760if v.Character ~= nil and Head then
761local ScreenPosition, Vis = Camera:WorldToViewportPoint(Head.Position);
762if Vis then
763local Color = _G.SelectedColor
764
765local ScreenPositionUpper = Camera:WorldToViewportPoint(Head.CFrame * CFrame.new(0, Head.Size.Y, 0).p);
766local Scale = Head.Size.Y / 2;
767
768if Options.ShowDot.Value then
769local Top = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, Scale, 0)).p);
770local Bottom = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, -Scale, 0)).p);
771local Radius = (Top - Bottom).y;
772
773HeadDot.Visible = true;
774HeadDot.Color = Color;
775HeadDot.Position = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
776HeadDot.Radius = Radius;
777else
778HeadDot.Visible = false;
779end
780if Options.ShowTracers.Value then
781Tracer.Visible = true;
782Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
783Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
784Tracer.Color = Color;
785Tracer.Thickness = 0.3;
786else
787Tracer.Visible = false;
788end
789if Options.ShowBoxes.Value and HumanoidRootPart then
790Box:Update(HumanoidRootPart.CFrame, Vector3.new(2, 3, 0) * (Scale * 2), Color);
791else
792Box:SetVisible(false);
793end
794else
795NameTag.Visible = false;
796DistanceTag.Visible = false;
797Tracer.Visible = false;
798HeadDot.Visible = false;
799
800Box:SetVisible(false);
801end
802end
803else
804NameTag.Visible = false;
805DistanceTag.Visible = false;
806Tracer.Visible = false;
807HeadDot.Visible = false;
808
809Box:SetVisible(false);
810end
811
812shared.PlayerData[v.Name] = Data;
813end
814end
815end
816
817function Update()
818for i, v in pairs(shared.PlayerData) do
819if not Players:FindFirstChild(tostring(i)) then
820GetTableData(v.Instances)(function(i, obj)
821obj.Visible = false;
822obj:Remove();
823v.Instances[i] = nil;
824end)
825shared.PlayerData[i] = nil;
826end
827end
828
829
830if Options.MenuOpen.Value and MenuLoaded then
831local MLocation = GetMouseLocation();
832shared.MenuDrawingData.Instances.Main.Color = Color3.fromHSV(tick() * 24 % 255/255, 1, 1);
833local MainInstance = Menu:GetInstance'Main';
834local Values = {
835MainInstance.Position.X;
836MainInstance.Position.Y;
837MainInstance.Position.X + MainInstance.Size.X;
838MainInstance.Position.Y + MainInstance.Size.Y;
839};
840if MainInstance and MouseHoveringOver(Values) then
841Debounce.CursorVis = true;
842-- GUIService:SetMenuIsOpen(true);
843Menu:UpdateMenuInstance'Cursor1'{
844Visible = true;
845From = Vector2.new(MLocation.x, MLocation.y);
846To = Vector2.new(MLocation.x + 5, MLocation.y + 6);
847}
848Menu:UpdateMenuInstance'Cursor2'{
849Visible = true;
850From = Vector2.new(MLocation.x, MLocation.y);
851To = Vector2.new(MLocation.x, MLocation.y + 8);
852}
853Menu:UpdateMenuInstance'Cursor3'{
854Visible = true;
855From = Vector2.new(MLocation.x, MLocation.y + 6);
856To = Vector2.new(MLocation.x + 5, MLocation.y + 5);
857}
858else
859if Debounce.CursorVis then
860Debounce.CursorVis = false;
861-- GUIService:SetMenuIsOpen(false);
862Menu:UpdateMenuInstance'Cursor1'{Visible = false};
863Menu:UpdateMenuInstance'Cursor2'{Visible = false};
864Menu:UpdateMenuInstance'Cursor3'{Visible = false};
865end
866end
867if MouseHeld then
868if Dragging then
869DraggingWhat.Slider.Position = Vector2.new(math.clamp(MLocation.X, DraggingWhat.Line.From.X, DraggingWhat.Line.To.X), DraggingWhat.Slider.Position.Y);
870local Percent = (DraggingWhat.Slider.Position.X - DraggingWhat.Line.From.X) / ((DraggingWhat.Line.To.X - DraggingWhat.Line.From.X));
871local Value = CalculateValue(DraggingWhat.Min, DraggingWhat.Max, Percent);
872DraggingWhat.Option(Value);
873elseif DraggingUI then
874Debounce.UIDrag = true;
875local Main = Menu:GetInstance'Main';
876local MousePos = GetMouseLocation();
877Main.Position = MousePos + DragOffset;
878end
879else
880Dragging = false;
881if DraggingUI and Debounce.UIDrag then
882Debounce.UIDrag = false;
883DraggingUI = false;
884CreateMenu(Menu:GetInstance'Main'.Position);
885end
886end
887if not Debounce.Menu then
888Debounce.Menu = true;
889ToggleMenu();
890end
891elseif Debounce.Menu and not Options.MenuOpen.Value then
892Debounce.Menu = false;
893ToggleMenu();
894end
895end
896
897RunService:UnbindFromRenderStep(GetDataName);
898RunService:UnbindFromRenderStep(UpdateName);
899
900RunService:BindToRenderStep(GetDataName, 1, UpdatePlayerData);
901RunService:BindToRenderStep(UpdateName, 1, Update);
902
903local _BodyPart = "Head"
904local Player = game:GetService("Players").LocalPlayer
905local Mouse = Player:GetMouse()
906local CurrentCamera = game:GetService("Workspace").CurrentCamera
907local Enabled = false
908local Camera = workspace.CurrentCamera
909
910local Settings = {}
911Settings["Aimlock"] = false
912Settings["AllowTeam"] = false
913Settings["ll1l1ii1"] = false
914
915function NearestPLR()
916local players = {}
917local plrhld = {}
918local dists = {}
919for i, v in pairs(game:GetService("Players"):GetPlayers()) do
920if v~=Player then
921table.insert(players,v)
922end
923end
924for i, v in pairs(players) do
925if v and (v.Character)~=nil then
926local head = v.Character:FindFirstChild(_BodyPart)
927
928if head~=nil then
929local dist = (head.Position-game:GetService("Workspace").CurrentCamera.CoordinateFrame.p).magnitude
930plrhld[v.Name..i]={}
931plrhld[v.Name..i].dist=dist
932plrhld[v.Name..i].plr=v
933local ray = Ray.new(game:GetService("Workspace").CurrentCamera.CoordinateFrame.p,(Mouse.Hit.p-game:GetService("Workspace").CurrentCamera.CoordinateFrame.p).unit*dist)
934local hit,pos = game:GetService("Workspace"):FindPartOnRay(ray,game:GetService("Workspace"))
935local diff = math.floor((pos-head.Position).magnitude)
936plrhld[v.Name..i].diff=diff
937table.insert(dists,diff)
938end
939end
940end
941if unpack(dists) == nil then
942return false
943end
944local ldist = math.floor(math.min(unpack(dists)))
945if ldist > 65 then
946return false
947end
948for i, v in pairs(plrhld) do
949if v.diff==ldist then
950return v.plr
951end
952end
953return false
954end
955
956Mouse.Button1Down:Connect(function()
957 Enabled = true
958end)
959Mouse.Button1Up:Connect(function()
960 Enabled = false
961end)
962Mouse.Button2Down:Connect(function()
963 Enabled = true
964end)
965Mouse.Button2Up:Connect(function()
966 Enabled = false
967end)
968
969local library = loadstring(game:HttpGet("https://pastebin.com/raw/y0PDKyp8"))()
970
971local AimbotTab = library:CreateTab("Aimbot", "Aimlock, Triggerbot & more.")
972local VisualsTab = library:CreateTab("Visuals", "ESP, Tracers, FOV & more.")
973
974AimbotTab:CreateSection("Aimbot")
975
976
977local OurBody = Player.Character or Player.CharacterAdded:wait()
978
979
980
981AimbotTab:CreateCheckbox("Aimlock", function(enabled)
982 Settings["Aimlock"] = enabled
983end)
984AimbotTab:CreateDropdown("Lock On", {"Head", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg"}, 1, function(option)
985 if option == "Head" then _BodyPart = "Head" end
986 if option == "Torso" then _BodyPart = "UpperTorso" end
987 if option == "Left Arm" then _BodyPart = "LeftUpperArm" end
988 if option == "Right Arm" then _BodyPart = "RightUpperArm" end
989 if option == "Left Leg" then _BodyPart = "LeftUpperLeg" end
990 if option == "Right Leg" then _BodyPart = "RightUpperLeg" end
991end)
992
993AimbotTab:CreateCheckbox("TriggerBot", function(val)
994 Settings["ll1l1ii1"] = val
995end)
996
997AimbotTab:CreateSection("Settings")
998AimbotTab:CreateCheckbox("Enable Team", function(enabled)
999 Settings["AllowTeam"] = enabled
1000end)
1001
1002game:GetService("RunService").RenderStepped:Connect(function()
1003 if Settings["ll1l1ii1"] and Mouse.Target ~= nil then
1004 if Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") and Mouse.Target.Parent ~= OurBody and Mouse.Target.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then
1005 if Settings["AllowTeam"] then
1006 if game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent) then
1007 mouse1press()
1008 wait(.3)
1009 mouse1release()
1010 end
1011 else
1012
1013 local plr = NearestPLR()
1014 if plr.TeamColor ~= game:GetService("Players").LocalPlayer.TeamColor then
1015 mouse1press()
1016 wait(.3)
1017 mouse1release()
1018 end
1019 end
1020 end
1021 end
1022
1023 if Enabled and Settings["Aimlock"] then
1024 local plr = NearestPLR()
1025 if (plr~=false) then
1026 local bPart = plr.Character:FindFirstChild(_BodyPart)
1027
1028 if Settings["AllowTeam"] then
1029 if plr.Character.Humanoid.Health > 0 then
1030
1031 if bPart then
1032 game:GetService("Workspace").CurrentCamera.CoordinateFrame = CFrame.new(game:GetService("Workspace").CurrentCamera.CoordinateFrame.p,bPart.CFrame.p)
1033 end
1034 end
1035 else
1036 if plr.TeamColor ~= game:GetService("Players").LocalPlayer.TeamColor and plr.Character.Humanoid.Health > 0 then
1037 if bPart then
1038 game:GetService("Workspace").CurrentCamera.CoordinateFrame = CFrame.new(game:GetService("Workspace").CurrentCamera.CoordinateFrame.p,bPart.CFrame.p)
1039 end
1040 end
1041 end
1042
1043 end
1044 end
1045end)
1046
1047VisualsTab:CreateSection("ESP")
1048
1049VisualsTab:CreateCheckbox("ESP", function(enabled)
1050Options('ShowBoxes', 'Show Boxes', enabled);
1051 while wait(3) do
1052 Options('ShowBoxes', 'Show Boxes', false);
1053 Options('ShowBoxes', 'Show Boxes', enabled);
1054 end
1055end)
1056
1057VisualsTab:CreateCheckbox("Tracers", function(enabled)
1058 Options('ShowTracers', 'Show Tracers', enabled);
1059 while wait(3) do
1060 Options('ShowTracers', 'Show Tracers', false);
1061 Options('ShowTracers', 'Show Tracers', enabled);
1062 end
1063end)
1064
1065VisualsTab:CreateSection("Settings")
1066
1067VisualsTab:CreateCheckbox("Show Team", function(enabled)
1068 Options('ShowTeam', 'Show Team', enabled);
1069end)
1070
1071VisualsTab:CreateColorPicker("Visual Color", Color3.fromRGB(255, 255, 255), function(a)
1072 _G.SelectedColor = a
1073end)