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