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