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