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