· 6 years ago · Sep 02, 2019, 03:26 AM
1assert(Drawing, 'exploit not supported')
2
3local UserInputService = game:GetService'UserInputService';
4local HttpService = game:GetService'HttpService';
5local GUIService = game:GetService'GuiService';
6local RunService = game:GetService'RunService';
7local Players = game:GetService'Players';
8local LocalPlayer = Players.LocalPlayer;
9local Camera = workspace.CurrentCamera
10local Mouse = LocalPlayer:GetMouse();
11local Menu = {};
12local MouseHeld = false;
13local LastRefresh = 0;
14local OptionsFile = 'IC3_ESP_SETTINGS.dat';
15local Binding = false;
16local BindedKey = nil;
17local OIndex = 0;
18local LineBox = {};
19local UIButtons = {};
20local Sliders = {};
21local Dragging = false;
22local DraggingUI = false;
23local DragOffset = Vector2.new();
24local DraggingWhat = nil;
25local OldData = {};
26local IgnoreList = {};
27local Red = Color3.new(1, 0, 0);
28local Green = Color3.new(0, 1, 0);
29local MenuLoaded = false;
30local ErrorLogging = false;
31
32-- local _pc = pcall;
33-- local pcall = ErrorLogging and function(f, ...)
34-- local ret, err = _pc(f, ...);
35
36-- if not ret then
37-- warn(ret, err);
38-- warn(debug.traceback());
39-- end
40
41-- return ret, err;
42-- end or _pc;
43
44shared.MenuDrawingData = shared.MenuDrawingData or { Instances = {} };
45shared.InstanceData = shared.InstanceData or {};
46shared.RSName = shared.RSName or ('UnnamedESP_by_ic3-' .. HttpService:GenerateGUID(false));
47
48local GetDataName = shared.RSName .. '-GetData';
49local UpdateName = shared.RSName .. '-Update';
50
51local Debounce = setmetatable({}, {
52 __index = function(t, i)
53 return rawget(t, i) or false
54 end;
55});
56
57if shared.UESP_InputBeganCon then pcall(function() shared.UESP_InputBeganCon:disconnect() end); end
58if shared.UESP_InputEndedCon then pcall(function() shared.UESP_InputEndedCon:disconnect() end); end
59
60local RealPrint, LastPrintTick = print, 0;
61local LatestPrints = setmetatable({}, {
62 __index = function(t, i)
63 return rawget(t, i) or 0;
64 end
65});
66
67local function print(...)
68 local Content = unpack{...};
69 local print = RealPrint;
70
71 if tick() - LatestPrints[Content] > 5 then
72 LatestPrints[Content] = tick();
73 print(Content);
74 end
75end
76
77local function Set(t, i, v)
78 t[i] = v;
79end
80
81local Teams = {};
82local CustomTeams = { -- Games that don't use roblox's team system
83 [2563455047] = {
84 Initialize = function()
85 Teams.Sheriffs = {}; -- prevent big error
86 Teams.Bandits = {}; -- prevent big error
87 local Func = game:GetService'ReplicatedStorage':WaitForChild('RogueFunc', 1);
88 local Event = game:GetService'ReplicatedStorage':WaitForChild('RogueEvent', 1);
89 local S, B = Func:InvokeServer'AllTeamData';
90
91 Teams.Sheriffs = S;
92 Teams.Bandits = B;
93
94 Event.OnClientEvent:connect(function(id, PlayerName, Team, Remove) -- stolen straight from decompiled src lul
95 if id == 'UpdateTeam' then
96 local TeamTable, NotTeamTable
97 if Team == 'Bandits' then
98 TeamTable = TDM.Bandits
99 NotTeamTable = TDM.Sheriffs
100 else
101 TeamTable = TDM.Sheriffs
102 NotTeamTable = TDM.Bandits
103 end
104 if Remove then
105 TeamTable[PlayerName] = nil
106 else
107 TeamTable[PlayerName] = true
108 NotTeamTable[PlayerName] = nil
109 end
110 if PlayerName == LocalPlayer.Name then
111 TDM.Friendlys = TeamTable
112 TDM.Enemies = NotTeamTable
113 end
114 end
115 end)
116 end;
117 CheckTeam = function(Player)
118 local LocalTeam = Teams.Sheriffs[LocalPlayer.Name] and Teams.Sheriffs or Teams.Bandits;
119
120 return LocalTeam[Player.Name] and true or false;
121 end;
122 };
123}
124
125local RenderList = {Instances = {}};
126function RenderList:AddOrUpdateInstance(Instance, Obj2Draw, Text, Color)
127 -- print(Instance, Obj2Draw, Text, Color);
128 RenderList.Instances[Instance] = { ParentInstance = Instance; Instance = Obj2Draw; Text = Text; Color = Color };
129 return RenderList.Instances[Instance];
130end
131
132if bind then
133 -- bind('f2', function()
134 -- print(RenderList:AddOrUpdateInstance(LocalPlayer.Character, LocalPlayer.Character.Head, 'nigger', Color3.fromRGB(255, 255, 0)));
135 -- end)
136 -- bind('f3', function()
137 -- if tableToString then print(tableToString(RenderList)); end
138 -- end)
139end
140
141local CustomPlayerTag;
142local CustomESP;
143
144local Modules = {
145 [2262441883] = {
146 CustomPlayerTag = function(Player)
147 return Player:FindFirstChild'Job' and (' [' .. Player.Job.Value .. ']') or '';
148 end;
149 CustomESP = function()
150 if workspace:FindFirstChild'MoneyPrinters' then
151 for i, v in pairs(workspace.MoneyPrinters:GetChildren()) do
152 local Main = v:FindFirstChild'Main';
153 local Owner = v:FindFirstChild'TrueOwner';
154 local Money = v:FindFirstChild'Int' and v.Int:FindFirstChild'Money' or nil;
155 if Main and Owner and Money then
156 local O = tostring(Owner.Value);
157 local M = tostring(Money.Value);
158
159 pcall(RenderList.AddOrUpdateInstance, RenderList, v, Main, string.format('Money Printer\nOwned by %s\n[%s]', O, M), Color3.fromRGB(13, 255, 227));
160 end
161 end
162 end
163 end;
164 };
165 [3016661674] = {
166 CustomPlayerTag = function(Player)
167 local Name = '';
168
169 if Player:FindFirstChild'leaderstats' then
170 local Rank = '';
171 if Player.leaderstats:FindFirstChild'HouseRank' and Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.HouseRank.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.HouseRank.Value) then
172 Rank = Player.leaderstats.HouseRank.Value == 'Owner' and (Player.leaderstats.Gender.Value == 'Female' and 'Lady ' or 'Lord ') or '';
173 end
174 if Player.leaderstats:FindFirstChild'FirstName' and Player.leaderstats.FirstName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.FirstName.Value) then
175 Name = Name .. '\n[' .. Rank .. Player.leaderstats.FirstName.Value;
176 end
177 if Player.leaderstats:FindFirstChild'LastName' and Player.leaderstats.LastName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.LastName.Value) then
178 Name = Name .. ' ' .. Player.leaderstats.LastName.Value;
179 end
180 if not IsStringEmpty(Name) then Name = Name .. ']'; end
181 -- if Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.Gender.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.Gender.Value) then
182 -- Name = Name .. string.format(' [%s]', Player.leaderstats.Gender.Value:sub(1, 1));
183 -- end
184 end
185
186 return Name;
187 end;
188 };
189}
190
191if Modules[game.PlaceId] ~= nil then
192 local Module = Modules[game.PlaceId];
193 CustomPlayerTag = Module.CustomPlayerTag or nil;
194 CustomESP = Module.CustomESP or nil;
195end
196
197function GetMouseLocation()
198 return UserInputService:GetMouseLocation();
199end
200
201function MouseHoveringOver(Values)
202 local X1, Y1, X2, Y2 = Values[1], Values[2], Values[3], Values[4]
203 local MLocation = GetMouseLocation();
204 return (MLocation.x >= X1 and MLocation.x <= (X1 + (X2 - X1))) and (MLocation.y >= Y1 and MLocation.y <= (Y1 + (Y2 - Y1)));
205end
206
207function GetTableData(t) -- basically table.foreach i dont even know why i made this
208 if typeof(t) ~= 'table' then return end
209 return setmetatable(t, {
210 __call = function(t, func)
211 if typeof(func) ~= 'function' then return end;
212 for i, v in pairs(t) do
213 pcall(func, i, v);
214 end
215 end;
216 });
217end
218local function Format(format, ...)
219 return string.format(format, ...);
220end
221function CalculateValue(Min, Max, Percent)
222 return Min + math.floor(((Max - Min) * Percent) + .5);
223end
224
225function NewDrawing(InstanceName)
226 local Instance = Drawing.new(InstanceName);
227 return (function(Properties)
228 for i, v in pairs(Properties) do
229 pcall(Set, Instance, i, v);
230 end
231 return Instance;
232 end)
233end
234
235function Menu:AddMenuInstance(Name, DrawingType, Properties)
236 -- if shared.MenuDrawingData.Instances[Name] ~= nil then
237 -- shared.MenuDrawingData.Instances[Name]:Remove();
238 -- end
239 local Instance;
240
241 if shared.MenuDrawingData.Instances[Name] ~= nil then
242 Instance = shared.MenuDrawingData.Instances[Name];
243 for i, v in pairs(Properties) do
244 pcall(Set, Instance, i, v);
245 end
246 else
247 Instance = NewDrawing(DrawingType)(Properties);
248 end
249
250 shared.MenuDrawingData.Instances[Name] = Instance;
251
252 return Instance;
253end
254function Menu:UpdateMenuInstance(Name)
255 local Instance = shared.MenuDrawingData.Instances[Name];
256 if Instance ~= nil then
257 return (function(Properties)
258 for i, v in pairs(Properties) do
259 -- print(Format('%s %s -> %s', Name, tostring(i), tostring(v)));
260 pcall(Set, Instance, i, v);
261 end
262 return Instance;
263 end)
264 end
265end
266function Menu:GetInstance(Name)
267 return shared.MenuDrawingData.Instances[Name];
268end
269
270local Options = setmetatable({}, {
271 __call = function(t, ...)
272 local Arguments = {...};
273 local Name = Arguments[1];
274 OIndex = OIndex + 1; -- (typeof(Arguments[3]) == 'boolean' and 1 or 0);
275 rawset(t, Name, setmetatable({
276 Name = Arguments[1];
277 Text = Arguments[2];
278 Value = Arguments[3];
279 DefaultValue = Arguments[3];
280 AllArgs = Arguments;
281 Index = OIndex;
282 }, {
283 __call = function(t, v)
284 local self = t;
285
286 if typeof(t.Value) == 'function' then
287 t.Value();
288 elseif typeof(t.Value) == 'EnumItem' then
289 local BT = Menu:GetInstance(Format('%s_BindText', t.Name));
290 Binding = true;
291 local Val = 0
292 while Binding do
293 wait();
294 Val = (Val + 1) % 17;
295 BT.Text = Val <= 8 and '|' or '';
296 end
297 t.Value = BindedKey;
298 BT.Text = tostring(t.Value):match'%w+%.%w+%.(.+)';
299 BT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - BT.TextBounds.X - 20, -10);
300 else
301 local NewValue = v;
302 if NewValue == nil then NewValue = not t.Value; end
303 rawset(t, 'Value', NewValue);
304
305 if Arguments[2] ~= nil and Menu:GetInstance'TopBar'.Visible then
306 if typeof(Arguments[3]) == 'number' then
307 local AMT = Menu:GetInstance(Format('%s_AmountText', t.Name));
308 if AMT then
309 AMT.Text = tostring(t.Value);
310 AMT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - AMT.TextBounds.X - 10, -10);
311 end
312 else
313 local Inner = Menu:GetInstance(Format('%s_InnerCircle', t.Name));
314 if Inner then Inner.Visible = t.Value; end
315 end
316 end
317 end
318 end;
319 }));
320 end;
321})
322
323function Load()
324 local _, Result = pcall(readfile, OptionsFile);
325 if _ then -- extremely ugly code yea i know but i dont care p.s. i hate pcall
326 local _, Table = pcall(HttpService.JSONDecode, HttpService, Result);
327 if _ then
328 for i, v in pairs(Table) do
329 if Options[i] ~= nil and Options[i].Value ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
330 Options[i].Value = v.Value;
331 pcall(Options[i], v.Value);
332 end
333 end
334 end
335 end
336end
337
338Options('Enabled', 'ESP Enabled', true);
339Options('ShowTeam', 'Show Team', false);
340Options('ShowTeamColor', 'Show Team Color', false);
341Options('ShowName', 'Show Names', true);
342Options('ShowDistance', 'Show Distance', true);
343Options('ShowHealth', 'Show Health', true);
344Options('ShowBoxes', 'Show Boxes', true);
345Options('ShowTracers', 'Show Tracers', true);
346Options('ShowDot', 'Show Head Dot', false);
347Options('VisCheck', 'Visibility Check', false);
348Options('Crosshair', 'Crosshair', false);
349Options('TextOutline', 'Text Outline', true);
350Options('Rainbow', 'Rainbow Mode', false);
351Options('TextSize', 'Text Size', syn and 18 or 14, 10, 24); -- cuz synapse fonts look weird???
352Options('MaxDistance', 'Max Distance', 2500, 100, 25000);
353Options('RefreshRate', 'Refresh Rate (ms)', 5, 1, 200);
354Options('MenuKey', 'Menu Key', Enum.KeyCode.F4, 1);
355Options('ToggleKey', 'Toggle Key', Enum.KeyCode.F3, 1);
356Options('ResetSettings', 'Reset Settings', function()
357 for i, v in pairs(Options) do
358 if 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
359 Options[i](Options[i].DefaultValue);
360 end
361 end
362end, 4);
363Options('LoadSettings', 'Load Settings', Load, 3);
364Options('SaveSettings', 'Save Settings', function()
365 writefile(OptionsFile, HttpService:JSONEncode(Options));
366end, 2)
367-- Options.SaveSettings.Value();
368
369Load();
370
371Options('MenuOpen', nil, true);
372
373local function Combine(...)
374 local Output = {};
375 for i, v in pairs{...} do
376 if typeof(v) == 'table' then
377 table.foreach(v, function(i, v)
378 Output[i] = v;
379 end)
380 end
381 end
382 return Output
383end
384function IsStringEmpty(String)
385 if type(String) == 'string' then
386 return String:match'^%s+$' ~= nil or #String == 0 or String == '' or false;
387 end
388 return false
389end
390
391function LineBox:Create(Properties)
392 local Box = { Visible = true }; -- prevent errors not really though dont worry bout the Visible = true thing
393
394 local Properties = Combine({
395 Transparency = 1;
396 Thickness = 1;
397 Visible = true;
398 }, Properties);
399
400 Box['TopLeft'] = NewDrawing'Line'(Properties);
401 Box['TopRight'] = NewDrawing'Line'(Properties);
402 Box['BottomLeft'] = NewDrawing'Line'(Properties);
403 Box['BottomRight'] = NewDrawing'Line'(Properties);
404
405 function Box:Update(CF, Size, Color, Properties)
406 if not CF or not Size then return end
407
408 local TLPos, Visible1 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, Size.Y, 0)).p);
409 local TRPos, Visible2 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, Size.Y, 0)).p);
410 local BLPos, Visible3 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, -Size.Y, 0)).p);
411 local BRPos, Visible4 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, -Size.Y, 0)).p);
412
413 Visible1 = TLPos.Z > 0 -- (commented | reason: random flashes);
414 Visible2 = TRPos.Z > 0 -- (commented | reason: random flashes);
415 Visible3 = BLPos.Z > 0 -- (commented | reason: random flashes);
416 Visible4 = BRPos.Z > 0 -- (commented | reason: random flashes);
417
418 -- ## BEGIN UGLY CODE
419 if Visible1 then
420 Box['TopLeft'].Visible = true;
421 Box['TopLeft'].Color = Color;
422 Box['TopLeft'].From = Vector2.new(TLPos.X, TLPos.Y);
423 Box['TopLeft'].To = Vector2.new(TRPos.X, TRPos.Y);
424 else
425 Box['TopLeft'].Visible = false;
426 end
427 if Visible2 then
428 Box['TopRight'].Visible = true;
429 Box['TopRight'].Color = Color;
430 Box['TopRight'].From = Vector2.new(TRPos.X, TRPos.Y);
431 Box['TopRight'].To = Vector2.new(BRPos.X, BRPos.Y);
432 else
433 Box['TopRight'].Visible = false;
434 end
435 if Visible3 then
436 Box['BottomLeft'].Visible = true;
437 Box['BottomLeft'].Color = Color;
438 Box['BottomLeft'].From = Vector2.new(BLPos.X, BLPos.Y);
439 Box['BottomLeft'].To = Vector2.new(TLPos.X, TLPos.Y);
440 else
441 Box['BottomLeft'].Visible = false;
442 end
443 if Visible4 then
444 Box['BottomRight'].Visible = true;
445 Box['BottomRight'].Color = Color;
446 Box['BottomRight'].From = Vector2.new(BRPos.X, BRPos.Y);
447 Box['BottomRight'].To = Vector2.new(BLPos.X, BLPos.Y);
448 else
449 Box['BottomRight'].Visible = false;
450 end
451 -- ## END UGLY CODE
452 if Properties then
453 GetTableData(Properties)(function(i, v)
454 pcall(Set, Box['TopLeft'], i, v);
455 pcall(Set, Box['TopRight'], i, v);
456 pcall(Set, Box['BottomLeft'], i, v);
457 pcall(Set, Box['BottomRight'], i, v);
458 end)
459 end
460 end
461 function Box:SetVisible(bool)
462 pcall(Set, Box['TopLeft'], 'Visible', bool);
463 pcall(Set, Box['TopRight'], 'Visible', bool);
464 pcall(Set, Box['BottomLeft'], 'Visible', bool);
465 pcall(Set, Box['BottomRight'], 'Visible', bool);
466 end
467 function Box:Remove()
468 self:SetVisible(false);
469 Box['TopLeft']:Remove();
470 Box['TopRight']:Remove();
471 Box['BottomLeft']:Remove();
472 Box['BottomRight']:Remove();
473 end
474
475 return Box;
476end
477
478function CreateMenu(NewPosition) -- Create Menu
479 local function FromHex(HEX)
480 HEX = HEX:gsub('#', '');
481 return Color3.fromRGB(tonumber('0x' .. HEX:sub(1, 2)), tonumber('0x' .. HEX:sub(3, 4)), tonumber('0x' .. HEX:sub(5, 6)));
482 end
483
484 local Colors = {
485 Primary = {
486 Main = FromHex'424242';
487 Light = FromHex'6d6d6d';
488 Dark = FromHex'1b1b1b';
489 };
490 Secondary = {
491 Main = FromHex'e0e0e0';
492 Light = FromHex'ffffff';
493 Dark = FromHex'aeaeae';
494 };
495 };
496
497 MenuLoaded = false;
498
499 -- GetTableData(UIButtons)(function(i, v)
500 -- v.Instance.Visible = false;
501 -- v.Instance:Remove();
502 -- end)
503 -- GetTableData(Sliders)(function(i, v)
504 -- v.Instance.Visible = false;
505 -- v.Instance:Remove();
506 -- end)
507
508 UIButtons = {};
509 Sliders = {};
510
511 local BaseSize = Vector2.new(300, 630);
512 local BasePosition = NewPosition or Vector2.new(Camera.ViewportSize.X / 8 - (BaseSize.X / 2), Camera.ViewportSize.Y / 2 - (BaseSize.Y / 2));
513
514 Menu:AddMenuInstance('CrosshairX', 'Line', {
515 Visible = false;
516 Color = Color3.new(0, 1, 0);
517 Transparency = 1;
518 Thickness = 1;
519 });
520 Menu:AddMenuInstance('CrosshairY', 'Line', {
521 Visible = false;
522 Color = Color3.new(0, 1, 0);
523 Transparency = 1;
524 Thickness = 1;
525 });
526
527 delay(.025, function() -- since zindex doesnt exist
528 Menu:AddMenuInstance('Main', 'Square', {
529 Size = BaseSize;
530 Position = BasePosition;
531 Filled = false;
532 Color = Colors.Primary.Main;
533 Thickness = 3;
534 Visible = true;
535 });
536 end);
537 Menu:AddMenuInstance('TopBar', 'Square', {
538 Position = BasePosition;
539 Size = Vector2.new(BaseSize.X, 15);
540 Color = Colors.Primary.Dark;
541 Filled = true;
542 Visible = true;
543 });
544 Menu:AddMenuInstance('TopBarTwo', 'Square', {
545 Position = BasePosition + Vector2.new(0, 15);
546 Size = Vector2.new(BaseSize.X, 45);
547 Color = Colors.Primary.Main;
548 Filled = true;
549 Visible = true;
550 });
551 Menu:AddMenuInstance('TopBarText', 'Text', {
552 Size = 25;
553 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(25, 10);
554 Text = 'Unnamed ESP';
555 Color = Colors.Secondary.Light;
556 Visible = true;
557 });
558 Menu:AddMenuInstance('TopBarTextBR', 'Text', {
559 Size = 15;
560 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(BaseSize.X - 65, 25);
561 Text = 'by ic3w0lf';
562 Color = Colors.Secondary.Dark;
563 Visible = true;
564 });
565 Menu:AddMenuInstance('Filling', 'Square', {
566 Size = BaseSize - Vector2.new(0, 60);
567 Position = BasePosition + Vector2.new(0, 60);
568 Filled = true;
569 Color = Colors.Secondary.Main;
570 Transparency= .5;
571 Visible = true;
572 });
573
574 local CPos = 0;
575
576 GetTableData(Options)(function(i, v)
577 if typeof(v.Value) == 'boolean' and not IsStringEmpty(v.Text) and v.Text ~= nil then
578 CPos = CPos + 25;
579 local BaseSize = Vector2.new(BaseSize.X, 30);
580 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(30, v.Index * 25 - 10);
581 UIButtons[#UIButtons + 1] = {
582 Option = v;
583 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
584 Position = BasePosition - Vector2.new(30, 15);
585 Size = BaseSize;
586 Visible = false;
587 });
588 };
589 Menu:AddMenuInstance(Format('%s_OuterCircle', v.Name), 'Circle', {
590 Radius = 10;
591 Position = BasePosition;
592 Color = Colors.Secondary.Light;
593 Filled = true;
594 Visible = true;
595 });
596 Menu:AddMenuInstance(Format('%s_InnerCircle', v.Name), 'Circle', {
597 Radius = 7;
598 Position = BasePosition;
599 Color = Colors.Secondary.Dark;
600 Filled = true;
601 Visible = v.Value;
602 });
603 Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
604 Text = v.Text;
605 Size = 20;
606 Position = BasePosition + Vector2.new(20, -10);
607 Visible = true;
608 Color = Colors.Primary.Dark;
609 });
610 end
611 end)
612 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
613 if typeof(v.Value) == 'number' then
614 CPos = CPos + 25;
615
616 local BaseSize = Vector2.new(BaseSize.X, 30);
617 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
618
619 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
620 Text = v.Text;
621 Size = 20;
622 Position = BasePosition + Vector2.new(20, -10);
623 Visible = true;
624 Color = Colors.Primary.Dark;
625 });
626 local AMT = Menu:AddMenuInstance(Format('%s_AmountText', v.Name), 'Text', {
627 Text = tostring(v.Value);
628 Size = 20;
629 Position = BasePosition;
630 Visible = true;
631 Color = Colors.Primary.Dark;
632 });
633 local Line = Menu:AddMenuInstance(Format('%s_SliderLine', v.Name), 'Line', {
634 Transparency = 1;
635 Color = Colors.Primary.Dark;
636 Thickness = 3;
637 Visible = true;
638 From = BasePosition + Vector2.new(20, 20);
639 To = BasePosition + Vector2.new(BaseSize.X - 10, 20);
640 });
641 CPos = CPos + 10;
642 local Slider = Menu:AddMenuInstance(Format('%s_Slider', v.Name), 'Circle', {
643 Visible = true;
644 Filled = true;
645 Radius = 6;
646 Color = Colors.Secondary.Dark;
647 Position = BasePosition + Vector2.new(35, 20);
648 })
649
650 local CSlider = {Slider = Slider; Line = Line; Min = v.AllArgs[4]; Max = v.AllArgs[5]; Option = v};
651 Sliders[#Sliders + 1] = CSlider;
652
653 -- local Percent = (v.Value / CSlider.Max) * 100;
654 -- local Size = math.abs(Line.From.X - Line.To.X);
655 -- local Value = Size * (Percent / 100); -- this shit's inaccurate but fuck it i'm not even gonna bother fixing it
656
657 Slider.Position = BasePosition + Vector2.new(40, 20);
658
659 v.BaseSize = BaseSize;
660 v.BasePosition = BasePosition;
661 AMT.Position = BasePosition + Vector2.new(BaseSize.X - AMT.TextBounds.X - 10, -10)
662 end
663 end)
664 local FirstItem = false;
665 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
666 if typeof(v.Value) == 'EnumItem' then
667 CPos = CPos + (not FirstItem and 30 or 25);
668 FirstItem = true;
669
670 local BaseSize = Vector2.new(BaseSize.X, FirstItem and 30 or 25);
671 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
672
673 UIButtons[#UIButtons + 1] = {
674 Option = v;
675 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
676 Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
677 Visible = true;
678 Transparency= .5;
679 Position = BasePosition + Vector2.new(15, -10);
680 Color = Colors.Secondary.Light;
681 Filled = true;
682 });
683 };
684 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
685 Text = v.Text;
686 Size = 20;
687 Position = BasePosition + Vector2.new(20, -10);
688 Visible = true;
689 Color = Colors.Primary.Dark;
690 });
691 local BindText = Menu:AddMenuInstance(Format('%s_BindText', v.Name), 'Text', {
692 Text = tostring(v.Value):match'%w+%.%w+%.(.+)';
693 Size = 20;
694 Position = BasePosition;
695 Visible = true;
696 Color = Colors.Primary.Dark;
697 });
698
699 Options[i].BaseSize = BaseSize;
700 Options[i].BasePosition = BasePosition;
701 BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 20, -10);
702 end
703 end)
704 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
705 if typeof(v.Value) == 'function' then
706 local BaseSize = Vector2.new(BaseSize.X, 30);
707 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos + (25 * v.AllArgs[4]) - 35);
708
709 UIButtons[#UIButtons + 1] = {
710 Option = v;
711 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
712 Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
713 Visible = true;
714 Transparency= .5;
715 Position = BasePosition + Vector2.new(15, -10);
716 Color = Colors.Secondary.Light;
717 Filled = true;
718 });
719 };
720 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
721 Text = v.Text;
722 Size = 20;
723 Position = BasePosition + Vector2.new(20, -10);
724 Visible = true;
725 Color = Colors.Primary.Dark;
726 });
727
728 -- BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 10, -10);
729 end
730 end)
731
732 delay(.1, function()
733 MenuLoaded = true;
734 end);
735
736 -- this has to be at the bottom cuz proto drawing api doesnt have zindex :triumph:
737 Menu:AddMenuInstance('Cursor1', 'Line', {
738 Visible = false;
739 Color = Color3.new(1, 0, 0);
740 Transparency = 1;
741 Thickness = 2;
742 });
743 Menu:AddMenuInstance('Cursor2', 'Line', {
744 Visible = false;
745 Color = Color3.new(1, 0, 0);
746 Transparency = 1;
747 Thickness = 2;
748 });
749 Menu:AddMenuInstance('Cursor3', 'Line', {
750 Visible = false;
751 Color = Color3.new(1, 0, 0);
752 Transparency = 1;
753 Thickness = 2;
754 });
755end
756
757CreateMenu();
758
759shared.UESP_InputBeganCon = UserInputService.InputBegan:connect(function(input)
760 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
761 MouseHeld = true;
762 local Bar = Menu:GetInstance'TopBar';
763 local Values = {
764 Bar.Position.X;
765 Bar.Position.Y;
766 Bar.Position.X + Bar.Size.X;
767 Bar.Position.Y + Bar.Size.Y;
768 }
769 if MouseHoveringOver(Values) then -- and not syn then -- disable dragging for synapse cuz idk why it breaks
770 DraggingUI = true;
771 DragOffset = Menu:GetInstance'Main'.Position - GetMouseLocation();
772 else
773 for i, v in pairs(Sliders) do
774 local Values = {
775 v.Line.From.X - (v.Slider.Radius);
776 v.Line.From.Y - (v.Slider.Radius);
777 v.Line.To.X + (v.Slider.Radius);
778 v.Line.To.Y + (v.Slider.Radius);
779 };
780 if MouseHoveringOver(Values) then
781 DraggingWhat = v;
782 Dragging = true;
783 break
784 end
785 end
786 end
787 end
788end)
789shared.UESP_InputEndedCon = UserInputService.InputEnded:connect(function(input)
790 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
791 MouseHeld = false;
792 for i, v in pairs(UIButtons) do
793 local Values = {
794 v.Instance.Position.X;
795 v.Instance.Position.Y;
796 v.Instance.Position.X + v.Instance.Size.X;
797 v.Instance.Position.Y + v.Instance.Size.Y;
798 };
799 if MouseHoveringOver(Values) then
800 v.Option();
801 break -- prevent clicking 2 options
802 end
803 end
804 elseif input.UserInputType.Name == 'Keyboard' then
805 if Binding then
806 BindedKey = input.KeyCode;
807 Binding = false;
808 elseif input.KeyCode == Options.MenuKey.Value or (input.KeyCode == Enum.KeyCode.Home and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl)) then
809 Options.MenuOpen();
810 elseif input.KeyCode == Options.ToggleKey.Value then
811 Options.Enabled();
812 end
813 end
814end)
815
816function ToggleMenu()
817 if Options.MenuOpen.Value then
818 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
819 if OldData[v] then
820 pcall(Set, v, 'Visible', true);
821 end
822 end)
823 else
824 -- GUIService:SetMenuIsOpen(false);
825 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
826 OldData[v] = v.Visible;
827 if v.Visible then
828 pcall(Set, v, 'Visible', false);
829 end
830 end)
831 end
832end
833
834function CheckRay(Instance, Distance, Position, Unit)
835 local Pass = true;
836 local Model = Instance;
837
838 if Distance > 999 then return false; end
839
840 if Instance:IsA'Player' and not Instance.Character then
841 return false;
842 elseif Instance:IsA'Player' and Instance.Character then
843 Model = Instance.Character
844 else
845 Model = Instance.Parent;
846 if Model.Parent == workspace then
847 Model = Instance;
848 end
849 end
850
851 local _Ray = Ray.new(Position, Unit * Distance);
852
853 local List = {LocalPlayer.Character, Camera, Mouse.TargetFilter};
854
855 for i,v in pairs(IgnoreList) do table.insert(List, v); end;
856
857 local Hit = workspace:FindPartOnRayWithIgnoreList(_Ray, List);
858
859 if Hit and not Hit:IsDescendantOf(Model) then
860 Pass = false;
861 if Hit.Transparency >= .3 or not Hit.CanCollide and Hit.ClassName ~= Terrain then -- Detect invisible walls
862 IgnoreList[#IgnoreList + 1] = Hit;
863 end
864 end
865
866 return Pass;
867end
868
869function CheckTeam(Player)
870 if Player.Neutral and LocalPlayer.Neutral then return true; end
871 return Player.TeamColor == LocalPlayer.TeamColor;
872end
873
874local CustomTeam = CustomTeams[game.PlaceId];
875
876if CustomTeam ~= nil then
877 ypcall(CustomTeam.Initialize);
878 CheckTeam = CustomTeam.CheckTeam;
879end
880
881function CheckPlayer(Player)
882 if not Options.Enabled.Value then return false end
883
884 local Pass = true;
885 local Distance = 0;
886
887 if Player ~= LocalPlayer and Player.Character then
888 if not Options.ShowTeam.Value and CheckTeam(Player) then
889 Pass = false;
890 end
891
892 local Head = Player.Character:FindFirstChild'Head';
893
894 if Pass and Player.Character and Head then
895 Distance = (Camera.CFrame.p - Head.Position).magnitude;
896 if Options.VisCheck.Value then
897 Pass = CheckRay(Player, Distance, Camera.CFrame.p, (Head.Position - Camera.CFrame.p).unit);
898 end
899 if Distance > Options.MaxDistance.Value then
900 Pass = false;
901 end
902 end
903 else
904 Pass = false;
905 end
906
907 return Pass, Distance;
908end
909
910function CheckDistance(Instance)
911 if not Options.Enabled.Value then return false end
912
913 local Pass = true;
914 local Distance = 0;
915
916 if Instance ~= nil then
917 Distance = (Camera.CFrame.p - Instance.Position).magnitude;
918 if Options.VisCheck.Value then
919 Pass = CheckRay(Instance, Distance, Camera.CFrame.p, (Instance.Position - Camera.CFrame.p).unit);
920 end
921 if Distance > Options.MaxDistance.Value then
922 Pass = false;
923 end
924 else
925 Pass = false;
926 end
927
928 return Pass, Distance;
929end
930
931function UpdatePlayerData()
932 if (tick() - LastRefresh) > (Options.RefreshRate.Value / 1000) then
933 LastRefresh = tick();
934 if CustomESP and Options.Enabled.Value then
935 pcall(CustomESP);
936 end
937 for i, v in pairs(RenderList.Instances) do
938 if v.Instance ~= nil and v.Instance.Parent ~= nil and v.Instance:IsA'BasePart' then
939 local Data = shared.InstanceData[v.Instance:GetDebugId()] or { Instances = {}; DontDelete = true };
940
941 Data.Instance = v.Instance;
942
943 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
944 Transparency = 1;
945 Thickness = 2;
946 }
947 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
948 Size = Options.TextSize.Value;
949 Center = true;
950 Outline = Options.TextOutline.Value;
951 Visible = true;
952 };
953 Data.Instances['DistanceTag'] = Data.Instances['DistanceTag'] or NewDrawing'Text'{
954 Size = Options.TextSize.Value - 1;
955 Center = true;
956 Outline = Options.TextOutline.Value;
957 Visible = true;
958 };
959
960 local NameTag = Data.Instances['NameTag'];
961 local DistanceTag = Data.Instances['DistanceTag'];
962 local Tracer = Data.Instances['Tracer'];
963
964 local Pass, Distance = CheckDistance(v.Instance);
965
966 if Pass then
967 local ScreenPosition, Vis = Camera:WorldToViewportPoint(v.Instance.Position);
968
969 if ScreenPosition.Z > 0 then
970 local Color = v.Color;
971
972 local ScreenPositionUpper = ScreenPosition
973 -- Camera:WorldToViewportPoint((v.Instance.CFrame * CFrame.new(0, v.Instance.Size.Y, 0)).p);
974
975 if Options.ShowName.Value then
976 LocalPlayer.NameDisplayDistance = 0;
977 NameTag.Visible = true;
978 NameTag.Text = v.Text;
979 NameTag.Size = Options.TextSize.Value;
980 NameTag.Outline = Options.TextOutline.Value;
981 NameTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y);
982 NameTag.Color = Color;
983 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
984 NameTag.Font = Drawing.Fonts.UI;
985 end
986 else
987 LocalPlayer.NameDisplayDistance = 100;
988 NameTag.Visible = false;
989 end
990 if Options.ShowDistance.Value or Options.ShowHealth.Value then
991 DistanceTag.Visible = true;
992 DistanceTag.Size = Options.TextSize.Value - 1;
993 DistanceTag.Outline = Options.TextOutline.Value;
994 DistanceTag.Color = Color3.new(1, 1, 1);
995 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
996 NameTag.Font = Drawing.Fonts.UI;
997 end
998
999 local Str = '';
1000
1001 if Options.ShowDistance.Value then
1002 Str = Str .. Format('[%d] ', Distance);
1003 end
1004
1005 DistanceTag.Text = Str;
1006 DistanceTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y) + Vector2.new(0, NameTag.TextBounds.Y);
1007 else
1008 DistanceTag.Visible = false;
1009 end
1010 if Options.ShowTracers.Value then
1011 Tracer.Visible = true;
1012 Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
1013 Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1014 Tracer.Color = Color;
1015 else
1016 Tracer.Visible = false;
1017 end
1018 else
1019 NameTag.Visible = false;
1020 DistanceTag.Visible = false;
1021 Tracer.Visible = false;
1022 end
1023 else
1024 NameTag.Visible = false;
1025 DistanceTag.Visible = false;
1026 Tracer.Visible = false;
1027 end
1028
1029 Data.Instances['NameTag'] = NameTag;
1030 Data.Instances['DistanceTag'] = DistanceTag;
1031 Data.Instances['Tracer'] = Tracer;
1032
1033 shared.InstanceData[v.Instance:GetDebugId()] = Data;
1034 end
1035 end
1036 for i, v in pairs(Players:GetPlayers()) do
1037 local Data = shared.InstanceData[v.Name] or { Instances = {}; };
1038
1039 Data.Instances['Box'] = Data.Instances['Box'] or LineBox:Create{Thickness = 3};
1040 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
1041 Transparency = 1;
1042 Thickness = 2;
1043 }
1044 Data.Instances['HeadDot'] = Data.Instances['HeadDot'] or NewDrawing'Circle'{
1045 Filled = true;
1046 NumSides = 30;
1047 }
1048 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
1049 Size = Options.TextSize.Value;
1050 Center = true;
1051 Outline = Options.TextOutline.Value;
1052 Visible = true;
1053 };
1054 Data.Instances['DistanceHealthTag'] = Data.Instances['DistanceHealthTag'] or NewDrawing'Text'{
1055 Size = Options.TextSize.Value - 1;
1056 Center = true;
1057 Outline = Options.TextOutline.Value;
1058 Visible = true;
1059 };
1060
1061 local NameTag = Data.Instances['NameTag'];
1062 local DistanceTag = Data.Instances['DistanceHealthTag'];
1063 local Tracer = Data.Instances['Tracer'];
1064 local HeadDot = Data.Instances['HeadDot'];
1065 local Box = Data.Instances['Box'];
1066
1067 local Pass, Distance = CheckPlayer(v);
1068
1069 if Pass and v.Character then
1070 local Humanoid = v.Character:FindFirstChildOfClass'Humanoid';
1071 local Head = v.Character:FindFirstChild'Head';
1072 local HumanoidRootPart = v.Character:FindFirstChild'HumanoidRootPart';
1073 if v.Character ~= nil and Head and HumanoidRootPart then
1074 local ScreenPosition, Vis = Camera:WorldToViewportPoint(Head.Position);
1075
1076 if ScreenPosition.Z > 0 then
1077 local Color = Options.Rainbow.Value and Color3.fromHSV(tick() * 128 % 255/255, 1, 1) or (CheckTeam(v) and Green or Red);
1078
1079 if (Options.ShowTeamColor.Value) then Color = v.TeamColor.Color; end
1080
1081 local ScreenPositionUpper = Camera:WorldToViewportPoint((HumanoidRootPart:GetRenderCFrame() * CFrame.new(0, Head.Size.Y + HumanoidRootPart.Size.Y, 0)).p);
1082 local Scale = Head.Size.Y / 2;
1083
1084 if Options.ShowName.Value then
1085 NameTag.Visible = true;
1086 NameTag.Text = v.Name .. (CustomPlayerTag and CustomPlayerTag(v) or '');
1087 NameTag.Size = Options.TextSize.Value;
1088 NameTag.Outline = Options.TextOutline.Value;
1089 NameTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y) - Vector2.new(0, NameTag.TextBounds.Y);
1090 NameTag.Color = Color;
1091 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1092 NameTag.Font = Drawing.Fonts.UI;
1093 end
1094 else
1095 NameTag.Visible = false;
1096 end
1097 if Options.ShowDistance.Value or Options.ShowHealth.Value then
1098 DistanceTag.Visible = true;
1099 DistanceTag.Size = Options.TextSize.Value - 1;
1100 DistanceTag.Outline = Options.TextOutline.Value;
1101 DistanceTag.Color = Color3.new(1, 1, 1);
1102 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1103 NameTag.Font = Drawing.Fonts.UI;
1104 end
1105
1106 local Str = '';
1107
1108 if Options.ShowDistance.Value then
1109 Str = Str .. Format('[%d] ', Distance);
1110 end
1111 if Options.ShowHealth.Value and Humanoid then
1112 Str = Str .. Format('[%d/100]', Humanoid.Health / Humanoid.MaxHealth * 100);
1113 end
1114
1115 DistanceTag.Text = Str;
1116 DistanceTag.Position = (NameTag.Visible and NameTag.Position + Vector2.new(0, NameTag.TextBounds.Y) or Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y));
1117 else
1118 DistanceTag.Visible = false;
1119 end
1120 if Options.ShowDot.Value and Vis then
1121 local Top = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, Scale, 0)).p);
1122 local Bottom = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, -Scale, 0)).p);
1123 local Radius = (Top - Bottom).y;
1124
1125 HeadDot.Visible = true;
1126 HeadDot.Color = Color;
1127 HeadDot.Position = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1128 HeadDot.Radius = Radius;
1129 else
1130 HeadDot.Visible = false;
1131 end
1132 if Options.ShowTracers.Value then
1133 Tracer.Visible = true;
1134 Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
1135 Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1136 Tracer.Color = Color;
1137 else
1138 Tracer.Visible = false;
1139 end
1140 if Options.ShowBoxes.Value and Vis and HumanoidRootPart then
1141 Box:Update(HumanoidRootPart.CFrame, Vector3.new(2, 3, 0) * (Scale * 2), Color);
1142 else
1143 Box:SetVisible(false);
1144 end
1145 else
1146 NameTag.Visible = false;
1147 DistanceTag.Visible = false;
1148 Tracer.Visible = false;
1149 HeadDot.Visible = false;
1150
1151 Box:SetVisible(false);
1152 end
1153 end
1154 else
1155 NameTag.Visible = false;
1156 DistanceTag.Visible = false;
1157 Tracer.Visible = false;
1158 HeadDot.Visible = false;
1159
1160 Box:SetVisible(false);
1161 end
1162
1163 shared.InstanceData[v.Name] = Data;
1164 end
1165 end
1166end
1167
1168local LastInvalidCheck = 0;
1169
1170function Update()
1171 if tick() - LastInvalidCheck > 1 then
1172 LastInvalidCheck = tick();
1173
1174 if Camera.Parent ~= workspace then
1175 Camera = workspace.CurrentCamera;
1176 end
1177
1178 for i, v in pairs(shared.InstanceData) do
1179 if not Players:FindFirstChild(tostring(i)) then
1180 if not shared.InstanceData[i].DontDelete then
1181 GetTableData(v.Instances)(function(i, obj)
1182 obj.Visible = false;
1183 obj:Remove();
1184 v.Instances[i] = nil;
1185 end)
1186 shared.InstanceData[i] = nil;
1187 else
1188 if shared.InstanceData[i].Instance == nil or shared.InstanceData[i].Instance.Parent == nil then
1189 GetTableData(v.Instances)(function(i, obj)
1190 obj.Visible = false;
1191 obj:Remove();
1192 v.Instances[i] = nil;
1193 end)
1194 shared.InstanceData[i] = nil;
1195 end
1196 end
1197 end
1198 end
1199 end
1200
1201 local CX = Menu:GetInstance'CrosshairX';
1202 local CY = Menu:GetInstance'CrosshairY';
1203
1204 if Options.Crosshair.Value then
1205 CX.Visible = true;
1206 CY.Visible = true;
1207
1208 CX.To = Vector2.new((Camera.ViewportSize.X / 2) - 8, (Camera.ViewportSize.Y / 2));
1209 CX.From = Vector2.new((Camera.ViewportSize.X / 2) + 8, (Camera.ViewportSize.Y / 2));
1210 CY.To = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) - 8);
1211 CY.From = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) + 8);
1212 else
1213 CX.Visible = false;
1214 CY.Visible = false;
1215 end
1216
1217 if Options.MenuOpen.Value and MenuLoaded then
1218 local MLocation = GetMouseLocation();
1219 shared.MenuDrawingData.Instances.Main.Color = Color3.fromHSV(tick() * 24 % 255/255, 1, 1);
1220 local MainInstance = Menu:GetInstance'Main';
1221
1222 local Values = {
1223 MainInstance.Position.X;
1224 MainInstance.Position.Y;
1225 MainInstance.Position.X + MainInstance.Size.X;
1226 MainInstance.Position.Y + MainInstance.Size.Y;
1227 };
1228
1229 if MainInstance and MouseHoveringOver(Values) then
1230 Debounce.CursorVis = true;
1231 -- GUIService:SetMenuIsOpen(true);
1232 Menu:UpdateMenuInstance'Cursor1'{
1233 Visible = true;
1234 From = Vector2.new(MLocation.x, MLocation.y);
1235 To = Vector2.new(MLocation.x + 5, MLocation.y + 6);
1236 }
1237 Menu:UpdateMenuInstance'Cursor2'{
1238 Visible = true;
1239 From = Vector2.new(MLocation.x, MLocation.y);
1240 To = Vector2.new(MLocation.x, MLocation.y + 8);
1241 }
1242 Menu:UpdateMenuInstance'Cursor3'{
1243 Visible = true;
1244 From = Vector2.new(MLocation.x, MLocation.y + 6);
1245 To = Vector2.new(MLocation.x + 5, MLocation.y + 5);
1246 }
1247 else
1248 if Debounce.CursorVis then
1249 Debounce.CursorVis = false;
1250 -- GUIService:SetMenuIsOpen(false);
1251 Menu:UpdateMenuInstance'Cursor1'{Visible = false};
1252 Menu:UpdateMenuInstance'Cursor2'{Visible = false};
1253 Menu:UpdateMenuInstance'Cursor3'{Visible = false};
1254 end
1255 end
1256 if MouseHeld then
1257 if Dragging then
1258 DraggingWhat.Slider.Position = Vector2.new(math.clamp(MLocation.X, DraggingWhat.Line.From.X, DraggingWhat.Line.To.X), DraggingWhat.Slider.Position.Y);
1259 local Percent = (DraggingWhat.Slider.Position.X - DraggingWhat.Line.From.X) / ((DraggingWhat.Line.To.X - DraggingWhat.Line.From.X));
1260 local Value = CalculateValue(DraggingWhat.Min, DraggingWhat.Max, Percent);
1261 DraggingWhat.Option(Value);
1262 elseif DraggingUI then
1263 Debounce.UIDrag = true;
1264 local Main = Menu:GetInstance'Main';
1265 local MousePos = GetMouseLocation();
1266 Main.Position = MousePos + DragOffset;
1267 end
1268 else
1269 Dragging = false;
1270 if DraggingUI and Debounce.UIDrag then
1271 Debounce.UIDrag = false;
1272 DraggingUI = false;
1273 CreateMenu(Menu:GetInstance'Main'.Position);
1274 end
1275 end
1276 if not Debounce.Menu then
1277 Debounce.Menu = true;
1278 ToggleMenu();
1279 end
1280 elseif Debounce.Menu and not Options.MenuOpen.Value then
1281 Debounce.Menu = false;
1282 ToggleMenu();
1283 end
1284end
1285
1286RunService:UnbindFromRenderStep(GetDataName);
1287RunService:UnbindFromRenderStep(UpdateName);
1288
1289RunService:BindToRenderStep(GetDataName, 1, UpdatePlayerData);
1290RunService:BindToRenderStep(UpdateName, 1, Update);