· 5 years ago · Nov 12, 2020, 07:20 PM
1assert(Drawing, 'exploit not supported')
2
3if not syn and not PROTOSMASHER_LOADED then print'Unnamed ESP only officially supports Synapse and Protosmasher! If you\'re an exploit developer and have added drawing API to your exploit, try setting syn as true then checking if that works, otherwise, DM me on discord @ cppbook.org#1968 or add an issue to the Unnamed ESP Github Repository and I\'ll see it through email!' end
4
5local UserInputService = game:GetService'UserInputService';
6local HttpService = game:GetService'HttpService';
7local GUIService = game:GetService'GuiService';
8local TweenService = game:GetService'TweenService';
9local RunService = game:GetService'RunService';
10local Players = game:GetService'Players';
11local LocalPlayer = Players.LocalPlayer;
12local Camera = workspace.CurrentCamera;
13local Mouse = LocalPlayer:GetMouse();
14local V2New = Vector2.new;
15local V3New = Vector3.new;
16local WTVP = Camera.WorldToViewportPoint;
17local WorldToViewport = function(...) return WTVP(Camera, ...) end;
18local Menu = {};
19local MouseHeld = false;
20local LastRefresh = 0;
21local OptionsFile = 'IC3_ESP_SETTINGS.dat';
22local Binding = false;
23local BindedKey = nil;
24local OIndex = 0;
25local LineBox = {};
26local UIButtons = {};
27local Sliders = {};
28local ColorPicker = { Loading = false; LastGenerated = 0 };
29local Dragging = false;
30local DraggingUI = false;
31local Rainbow = false;
32local DragOffset = V2New();
33local DraggingWhat = nil;
34local OldData = {};
35local IgnoreList = {};
36local EnemyColor = Color3.new(1, 0, 0);
37local TeamColor = Color3.new(0, 1, 0);
38local MenuLoaded = false;
39local ErrorLogging = false;
40local TracerPosition = V2New(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y - 135);
41local DragTracerPosition= false;
42local SubMenu = {};
43local IsSynapse = syn and not PROTOSMASHER_LOADED;
44local Connections = { Active = {} };
45local Signal = {}; Signal.__index = Signal;
46local GetCharacter;
47local CurrentColorPicker;
48local Spectating;
49
50-- if not PROTOSMASHER_LOADED then Drawing.UseCompatTransparency = true; end -- For Elysian
51
52shared.MenuDrawingData = shared.MenuDrawingData or { Instances = {} };
53shared.InstanceData = shared.InstanceData or {};
54shared.RSName = shared.RSName or ('UnnamedESP_by_ic3-' .. HttpService:GenerateGUID(false));
55
56local GetDataName = shared.RSName .. '-GetData';
57local UpdateName = shared.RSName .. '-Update';
58
59local Debounce = setmetatable({}, {
60 __index = function(t, i)
61 return rawget(t, i) or false
62 end;
63});
64
65if shared.UESP_InputChangedCon then shared.UESP_InputChangedCon:Disconnect() end
66if shared.UESP_InputBeganCon then shared.UESP_InputBeganCon:Disconnect() end
67if shared.UESP_InputEndedCon then shared.UESP_InputEndedCon:Disconnect() end
68if shared.CurrentColorPicker then shared.CurrentColorPicker:Dispose() end
69
70local RealPrint, LastPrintTick = print, 0;
71local LatestPrints = setmetatable({}, { __index = function(t, i) return rawget(t, i) or 0 end });
72
73local function print(...)
74 local Content = unpack{...};
75 local print = RealPrint;
76
77 if tick() - LatestPrints[Content] > 5 then
78 LatestPrints[Content] = tick();
79 print(Content);
80 end
81end
82
83local function FromHex(HEX)
84 HEX = HEX:gsub('#', '');
85
86 return Color3.fromRGB(tonumber('0x' .. HEX:sub(1, 2)), tonumber('0x' .. HEX:sub(3, 4)), tonumber('0x' .. HEX:sub(5, 6)));
87end
88
89local function IsStringEmpty(String)
90 if type(String) == 'string' then
91 return String:match'^%s+$' ~= nil or #String == 0 or String == '' or false;
92 end
93
94 return false;
95end
96
97local function Set(t, i, v)
98 t[i] = v;
99end
100
101local Teams = {};
102local CustomTeams = { -- Games that don't use roblox's team system
103 [2563455047] = {
104 Initialize = function()
105 Teams.Sheriffs = {}; -- prevent big error
106 Teams.Bandits = {}; -- prevent big error
107 local Func = game:GetService'ReplicatedStorage':WaitForChild('RogueFunc', 1);
108 local Event = game:GetService'ReplicatedStorage':WaitForChild('RogueEvent', 1);
109 local S, B = Func:InvokeServer'AllTeamData';
110
111 Teams.Sheriffs = S;
112 Teams.Bandits = B;
113
114 Event.OnClientEvent:Connect(function(id, PlayerName, Team, Remove) -- stolen straight from decompiled src lul
115 if id == 'UpdateTeam' then
116 local TeamTable, NotTeamTable
117 if Team == 'Bandits' then
118 TeamTable = TDM.Bandits
119 NotTeamTable = TDM.Sheriffs
120 else
121 TeamTable = TDM.Sheriffs
122 NotTeamTable = TDM.Bandits
123 end
124 if Remove then
125 TeamTable[PlayerName] = nil
126 else
127 TeamTable[PlayerName] = true
128 NotTeamTable[PlayerName] = nil
129 end
130 if PlayerName == LocalPlayer.Name then
131 TDM.Friendlys = TeamTable
132 TDM.Enemies = NotTeamTable
133 end
134 end
135 end)
136 end;
137 CheckTeam = function(Player)
138 local LocalTeam = Teams.Sheriffs[LocalPlayer.Name] and Teams.Sheriffs or Teams.Bandits;
139
140 return LocalTeam[Player.Name] and true or false;
141 end;
142 };
143 [3016661674] = {
144 CheckTeam = function(Player)
145 local LocalStats = LocalPlayer:FindFirstChild'leaderstats';
146 local LocalLastName = LocalStats and LocalStats:FindFirstChild'LastName'; if not LocalLastName or IsStringEmpty(LocalLastName.Value) then return true; end
147 local PlayerStats = Player:FindFirstChild'leaderstats';
148 local PlayerLastName = PlayerStats and PlayerStats:FindFirstChild'LastName'; if not PlayerLastName then return false; end
149
150 return PlayerLastName.Value == LocalLastName.Value;
151 end;
152 };
153};
154
155CustomTeams[5208655184] = CustomTeams[3016661674]; -- rogue gaia
156CustomTeams[3541987450] = CustomTeams[3016661674]; -- rogue khei
157
158local RenderList = {Instances = {}};
159
160function RenderList:AddOrUpdateInstance(Instance, Obj2Draw, Text, Color)
161 RenderList.Instances[Instance] = { ParentInstance = Instance; Instance = Obj2Draw; Text = Text; Color = Color };
162 return RenderList.Instances[Instance];
163end
164
165local CustomPlayerTag;
166local CustomESP;
167local CustomCharacter;
168
169local Modules = {
170 [292439477] = {
171 CustomESP = function()
172 if not shared.PF_Replication then
173 for i, v in pairs(getgc(true)) do
174 if typeof(v) == 'table' and rawget(v, 'getbodyparts') then
175 shared.PF_Replication = v;
176 break;
177 end
178 end
179 else
180 for Index, Player in pairs(Players:GetPlayers()) do
181 if Player == LocalPlayer then continue end
182
183 local Body = shared.PF_Replication.getbodyparts(Player);
184
185 if Body and typeof(Body) == 'table' and rawget(Body, 'rootpart') then
186 Player.Character = Body.rootpart.Parent;
187 else
188 Player.Character = nil;
189 end
190 end
191 end
192 end
193 };
194 [2950983942] = {
195 CustomCharacter = function(Player)
196 if workspace:FindFirstChild'Players' then
197 return workspace.Players:FindFirstChild(Player.Name);
198 end
199 end
200 };
201 [2262441883] = {
202 CustomPlayerTag = function(Player)
203 return Player:FindFirstChild'Job' and (' [' .. Player.Job.Value .. ']') or '';
204 end;
205 CustomESP = function()
206 if workspace:FindFirstChild'MoneyPrinters' then
207 for i, v in pairs(workspace.MoneyPrinters:GetChildren()) do
208 local Main = v:FindFirstChild'Main';
209 local Owner = v:FindFirstChild'TrueOwner';
210 local Money = v:FindFirstChild'Int' and v.Int:FindFirstChild'Money' or nil;
211 if Main and Owner and Money then
212 local O = tostring(Owner.Value);
213 local M = tostring(Money.Value);
214
215 pcall(RenderList.AddOrUpdateInstance, RenderList, v, Main, string.format('Money Printer\nOwned by %s\n[%s]', O, M), Color3.fromRGB(13, 255, 227));
216 end
217 end
218 end
219 end;
220 };
221 [4801598506] = {
222 CustomESP = function()
223 if workspace:FindFirstChild'Mobs' and workspace.Mobs:FindFirstChild'Forest1' then
224 for i, v in pairs(workspace.Mobs.Forest1:GetChildren()) do
225 local Main = v:FindFirstChild'Head';
226 local Hum = v:FindFirstChild'Mob';
227
228 if Main and Hum then
229 pcall(RenderList.AddOrUpdateInstance, RenderList, v, Main, string.format('[%s] [%s/%s]', v.Name, Hum.Health, Hum.MaxHealth), Color3.fromRGB(13, 255, 227));
230 end
231 end
232 end
233 end;
234 };
235 [2555873122] = {
236 CustomESP = function()
237 if workspace:FindFirstChild'WoodPlanks' then
238 for i, v in pairs(workspace:GetChildren()) do
239 if v.Name == 'WoodPlanks' then
240 local Main = v:FindFirstChild'Wood';
241
242 if Main then
243 pcall(RenderList.AddOrUpdateInstance, RenderList, v, Main, 'Wood Planks', Color3.fromRGB(13, 255, 227));
244 end
245 end
246 end
247 end
248 end;
249 };
250 [5208655184] = {
251 CustomPlayerTag = function(Player)
252 local Name = '';
253
254 if Player:FindFirstChild'leaderstats' then
255 local Prefix = '';
256 local Extra = {};
257 Name = Name .. '\n[';
258
259 if Player.leaderstats:FindFirstChild'Prestige' and Player.leaderstats.Prestige.ClassName == 'IntValue' and Player.leaderstats.Prestige.Value > 0 then
260 Name = Name .. '#' .. tostring(Player.leaderstats.Prestige.Value) .. ' ';
261 end
262 if Player.leaderstats:FindFirstChild'HouseRank' and Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.HouseRank.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.HouseRank.Value) then
263 Prefix = Player.leaderstats.HouseRank.Value == 'Owner' and (Player.leaderstats.Gender.Value == 'Female' and 'Lady ' or 'Lord ') or '';
264 end
265 if Player.leaderstats:FindFirstChild'FirstName' and Player.leaderstats.FirstName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.FirstName.Value) then
266 Name = Name .. '' .. Prefix .. Player.leaderstats.FirstName.Value;
267 end
268 if Player.leaderstats:FindFirstChild'LastName' and Player.leaderstats.LastName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.LastName.Value) then
269 Name = Name .. ' ' .. Player.leaderstats.LastName.Value;
270 end
271
272 if not IsStringEmpty(Name) then Name = Name .. ']'; end
273
274 local Character = GetCharacter(Player);
275
276 if Character then
277 if Character and Character:FindFirstChild'Danger' then table.insert(Extra, 'D'); end
278 if Character:FindFirstChild'ManaAbilities' and Character.ManaAbilities:FindFirstChild'ManaSprint' then table.insert(Extra, 'D1'); end
279
280 if Character:FindFirstChild'Mana' then table.insert(Extra, 'M' .. math.floor(Character.Mana.Value)); end
281 if Character:FindFirstChild'Vampirism' then table.insert(Extra, 'V'); end
282 if Character:FindFirstChild'Observe' then table.insert(Extra, 'ILL'); end
283 if Character:FindFirstChild'Inferi' then table.insert(Extra, 'NEC'); end
284 if Character:FindFirstChild'World\'s Pulse' then table.insert(Extra, 'DZIN'); end
285 if Character:FindFirstChild'Shift' then table.insert(Extra, 'MAD'); end
286 if Character:FindFirstChild'Head' and Character.Head:FindFirstChild'FacialMarking' then
287 local FM = Character.Head:FindFirstChild'FacialMarking';
288 if FM.Texture == 'http://www.roblox.com/asset/?id=4072968006' then
289 table.insert(Extra, 'HEALER');
290 elseif FM.Texture == 'http://www.roblox.com/asset/?id=4072914434' then
291 table.insert(Extra, 'SEER');
292 elseif FM.Texture == 'http://www.roblox.com/asset/?id=4094417635' then
293 table.insert(Extra, 'JESTER');
294 end
295 end
296 end
297 if Player:FindFirstChild'Backpack' then
298 if Player.Backpack:FindFirstChild'Observe' then table.insert(Extra, 'ILL'); end
299 if Player.Backpack:FindFirstChild'Inferi' then table.insert(Extra, 'NEC'); end
300 if Player.Backpack:FindFirstChild'World\'s Pulse' then table.insert(Extra, 'DZIN'); end
301 if Player.Backpack:FindFirstChild'Shift' then table.insert(Extra, 'MAD'); end
302 end
303
304 if #Extra > 0 then Name = Name .. ' [' .. table.concat(Extra, '-') .. ']'; end
305 end
306
307 return Name;
308 end;
309 };
310 [3541987450] = {
311 CustomPlayerTag = function(Player)
312 local Name = '';
313
314 if Player:FindFirstChild'leaderstats' then
315 Name = Name .. '\n[';
316 local Prefix = '';
317 local Extra = {};
318 if Player.leaderstats:FindFirstChild'Prestige' and Player.leaderstats.Prestige.ClassName == 'IntValue' and Player.leaderstats.Prestige.Value > 0 then
319 Name = Name .. '#' .. tostring(Player.leaderstats.Prestige.Value) .. ' ';
320 end
321 if Player.leaderstats:FindFirstChild'HouseRank' and Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.HouseRank.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.HouseRank.Value) then
322 Prefix = Player.leaderstats.HouseRank.Value == 'Owner' and (Player.leaderstats.Gender.Value == 'Female' and 'Lady ' or 'Lord ') or '';
323 end
324 if Player.leaderstats:FindFirstChild'FirstName' and Player.leaderstats.FirstName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.FirstName.Value) then
325 Name = Name .. '' .. Prefix .. Player.leaderstats.FirstName.Value;
326 end
327 if Player.leaderstats:FindFirstChild'LastName' and Player.leaderstats.LastName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.LastName.Value) then
328 Name = Name .. ' ' .. Player.leaderstats.LastName.Value;
329 end
330 if Player.leaderstats:FindFirstChild'UberTitle' and Player.leaderstats.UberTitle.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.UberTitle.Value) then
331 Name = Name .. ', ' .. Player.leaderstats.UberTitle.Value;
332 end
333
334 if not IsStringEmpty(Name) then Name = Name .. ']'; end
335
336 local Character = GetCharacter(Player);
337
338 if Character then
339 if Character and Character:FindFirstChild'Danger' then table.insert(Extra, 'D'); end
340 if Character:FindFirstChild'ManaAbilities' and Character.ManaAbilities:FindFirstChild'ManaSprint' then table.insert(Extra, 'D1'); end
341
342 if Character:FindFirstChild'Mana' then table.insert(Extra, 'M' .. math.floor(Character.Mana.Value)); end
343 if Character:FindFirstChild'Vampirism' then table.insert(Extra, 'V'); end
344 if Character:FindFirstChild'Observe' then table.insert(Extra, 'ILL'); end
345 if Character:FindFirstChild'Inferi' then table.insert(Extra, 'NEC'); end
346
347 if Character:FindFirstChild'World\'s Pulse' then table.insert(Extra, 'DZIN'); end
348 if Character:FindFirstChild'Head' and Character.Head:FindFirstChild'FacialMarking' then
349 local FM = Character.Head:FindFirstChild'FacialMarking';
350 if FM.Texture == 'http://www.roblox.com/asset/?id=4072968006' then
351 table.insert(Extra, 'HEALER');
352 elseif FM.Texture == 'http://www.roblox.com/asset/?id=4072914434' then
353 table.insert(Extra, 'SEER');
354 elseif FM.Texture == 'http://www.roblox.com/asset/?id=4094417635' then
355 table.insert(Extra, 'JESTER');
356 end
357 end
358 end
359 if Player:FindFirstChild'Backpack' then
360 if Player.Backpack:FindFirstChild'Observe' then table.insert(Extra, 'ILL'); end
361 if Player.Backpack:FindFirstChild'Inferi' then table.insert(Extra, 'NEC'); end
362 if Player.Backpack:FindFirstChild'World\'s Pulse' then table.insert(Extra, 'DZIN'); end
363 end
364
365 if #Extra > 0 then Name = Name .. ' [' .. table.concat(Extra, '-') .. ']'; end
366 end
367
368 return Name;
369 end;
370 };
371};
372
373if Modules[game.PlaceId] ~= nil then
374 local Module = Modules[game.PlaceId];
375 CustomPlayerTag = Module.CustomPlayerTag or nil;
376 CustomESP = Module.CustomESP or nil;
377 CustomCharacter = Module.CustomCharacter or nil;
378end
379
380function GetCharacter(Player)
381 return Player.Character or (CustomCharacter and CustomCharacter(Player));
382end
383
384function GetMouseLocation()
385 return UserInputService:GetMouseLocation();
386end
387
388function MouseHoveringOver(Values)
389 local X1, Y1, X2, Y2 = Values[1], Values[2], Values[3], Values[4]
390 local MLocation = GetMouseLocation();
391 return (MLocation.x >= X1 and MLocation.x <= (X1 + (X2 - X1))) and (MLocation.y >= Y1 and MLocation.y <= (Y1 + (Y2 - Y1)));
392end
393
394function GetTableData(t) -- basically table.foreach i dont even know why i made this
395 if typeof(t) ~= 'table' then return end
396
397 return setmetatable(t, {
398 __call = function(t, func)
399 if typeof(func) ~= 'function' then return end;
400 for i, v in pairs(t) do
401 pcall(func, i, v);
402 end
403 end;
404 });
405end
406local function Format(format, ...)
407 return string.format(format, ...);
408end
409function CalculateValue(Min, Max, Percent)
410 return Min + math.floor(((Max - Min) * Percent) + .5);
411end
412
413function NewDrawing(InstanceName)
414 local Instance = Drawing.new(InstanceName);
415 return (function(Properties)
416 for i, v in pairs(Properties) do
417 pcall(Set, Instance, i, v);
418 end
419 return Instance;
420 end)
421end
422
423function Menu:AddMenuInstance(Name, DrawingType, Properties)
424 local Instance;
425
426 if shared.MenuDrawingData.Instances[Name] ~= nil then
427 Instance = shared.MenuDrawingData.Instances[Name];
428 for i, v in pairs(Properties) do
429 pcall(Set, Instance, i, v);
430 end
431 else
432 Instance = NewDrawing(DrawingType)(Properties);
433 end
434
435 shared.MenuDrawingData.Instances[Name] = Instance;
436
437 return Instance;
438end
439function Menu:UpdateMenuInstance(Name)
440 local Instance = shared.MenuDrawingData.Instances[Name];
441 if Instance ~= nil then
442 return (function(Properties)
443 for i, v in pairs(Properties) do
444 pcall(Set, Instance, i, v);
445 end
446 return Instance;
447 end)
448 end
449end
450function Menu:GetInstance(Name)
451 return shared.MenuDrawingData.Instances[Name];
452end
453
454local Options = setmetatable({}, {
455 __call = function(t, ...)
456 local Arguments = {...};
457 local Name = Arguments[1];
458 OIndex = OIndex + 1;
459 rawset(t, Name, setmetatable({
460 Name = Arguments[1];
461 Text = Arguments[2];
462 Value = Arguments[3];
463 DefaultValue = Arguments[3];
464 AllArgs = Arguments;
465 Index = OIndex;
466 }, {
467 __call = function(t, v, force)
468 local self = t;
469
470 if typeof(t.Value) == 'function' then
471 t.Value();
472 elseif typeof(t.Value) == 'EnumItem' then
473 local BT = Menu:GetInstance(Format('%s_BindText', t.Name));
474 if not force then
475 Binding = true;
476 local Val = 0
477 while Binding do
478 wait();
479 Val = (Val + 1) % 17;
480 BT.Text = Val <= 8 and '|' or '';
481 end
482 end
483 t.Value = force and v or BindedKey;
484 if BT and t.BasePosition and t.BaseSize then
485 BT.Text = tostring(t.Value):match'%w+%.%w+%.(.+)';
486 BT.Position = t.BasePosition + V2New(t.BaseSize.X - BT.TextBounds.X - 20, -10);
487 end
488 else
489 local NewValue = v;
490 if NewValue == nil then NewValue = not t.Value; end
491 rawset(t, 'Value', NewValue);
492
493 if Arguments[2] ~= nil and Menu:GetInstance'TopBar'.Visible then
494 if typeof(Arguments[3]) == 'number' then
495 local AMT = Menu:GetInstance(Format('%s_AmountText', t.Name));
496 if AMT then
497 AMT.Text = tostring(t.Value);
498 end
499 else
500 local Inner = Menu:GetInstance(Format('%s_InnerCircle', t.Name));
501 if Inner then Inner.Visible = t.Value; end
502 end
503 end
504 end
505 end;
506 }));
507 end;
508})
509
510function Load()
511 local _, Result = pcall(readfile, OptionsFile);
512
513 if _ then -- extremely ugly code yea i know but i dont care p.s. i hate pcall
514 local _, Table = pcall(HttpService.JSONDecode, HttpService, Result);
515 if _ and typeof(Table) == 'table' then
516 for i, v in pairs(Table) do
517 if typeof(Options[i]) == 'table' and Options[i].Value ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
518 Options[i].Value = v.Value;
519 pcall(Options[i], v.Value);
520 end
521 end
522
523 if Table.TeamColor then TeamColor = Color3.new(Table.TeamColor.R, Table.TeamColor.G, Table.TeamColor.B) end
524 if Table.EnemyColor then EnemyColor = Color3.new(Table.EnemyColor.R, Table.EnemyColor.G, Table.EnemyColor.B) end
525
526 if typeof(Table.MenuKey) == 'string' then Options.MenuKey(Enum.KeyCode[Table.MenuKey], true) end
527 if typeof(Table.ToggleKey) == 'string' then Options.ToggleKey(Enum.KeyCode[Table.ToggleKey], true) end
528 end
529 end
530end
531
532Options('Enabled', 'ESP Enabled', true);
533Options('ShowTeam', 'Show Team', true);
534Options('ShowTeamColor', 'Show Team Color', false);
535Options('ShowName', 'Show Names', true);
536Options('ShowDistance', 'Show Distance', true);
537Options('ShowHealth', 'Show Health', true);
538Options('ShowBoxes', 'Show Boxes', true);
539Options('ShowTracers', 'Show Tracers', true);
540Options('ShowDot', 'Show Head Dot', false);
541Options('VisCheck', 'Visibility Check', false);
542Options('Crosshair', 'Crosshair', false);
543Options('TextOutline', 'Text Outline', true);
544-- Options('Rainbow', 'Rainbow Mode', false);
545Options('TextSize', 'Text Size', syn and 18 or 14, 10, 24); -- cuz synapse fonts look weird???
546Options('MaxDistance', 'Max Distance', 2500, 100, 25000);
547Options('RefreshRate', 'Refresh Rate (ms)', 5, 1, 200);
548Options('YOffset', 'Y Offset', 0, -200, 200);
549Options('MenuKey', 'Menu Key', Enum.KeyCode.F4, 1);
550Options('ToggleKey', 'Toggle Key', Enum.KeyCode.F3, 1);
551Options('ChangeColors', SENTINEL_LOADED and 'Sentinel Unsupported' or 'Change Colors', function()
552 if SENTINEL_LOADED then return end
553
554 SubMenu:Show(GetMouseLocation(), 'Unnamed Colors', {
555 {
556 Type = 'Color'; Text = 'Team Color'; Color = TeamColor;
557
558 Function = function(Circ, Position)
559 if tick() - ColorPicker.LastGenerated < 1 then return; end
560
561 if shared.CurrentColorPicker then shared.CurrentColorPicker:Dispose() end
562 local ColorPicker = ColorPicker.new(Position - V2New(-10, 50));
563 CurrentColorPicker = ColorPicker;
564 shared.CurrentColorPicker = CurrentColorPicker;
565 ColorPicker.ColorChanged:Connect(function(Color) Circ.Color = Color TeamColor = Color Options.TeamColor = Color end);
566 end
567 };
568 {
569 Type = 'Color'; Text = 'Enemy Color'; Color = EnemyColor;
570
571 Function = function(Circ, Position)
572 if tick() - ColorPicker.LastGenerated < 1 then return; end
573
574 if shared.CurrentColorPicker then shared.CurrentColorPicker:Dispose() end
575 local ColorPicker = ColorPicker.new(Position - V2New(-10, 50));
576 CurrentColorPicker = ColorPicker;
577 shared.CurrentColorPicker = CurrentColorPicker;
578 ColorPicker.ColorChanged:Connect(function(Color) Circ.Color = Color EnemyColor = Color Options.EnemyColor = Color end);
579 end
580 };
581 {
582 Type = 'Button'; Text = 'Reset Colors';
583
584 Function = function()
585 EnemyColor = Color3.new(1, 0, 0);
586 TeamColor = Color3.new(0, 1, 0);
587
588 local C1 = Menu:GetInstance'Sub-ColorPreview.1'; if C1 then C1.Color = TeamColor end
589 local C2 = Menu:GetInstance'Sub-ColorPreview.2'; if C2 then C2.Color = EnemyColor end
590 end
591 };
592 {
593 Type = 'Button'; Text = 'Rainbow Mode';
594
595 Function = function()
596 Rainbow = not Rainbow;
597 end
598 };
599 });
600end, 2);
601Options('ResetSettings', 'Reset Settings', function()
602 for i, v in pairs(Options) do
603 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' or typeof(Options[i].Value) == 'EnumItem') then
604 Options[i](Options[i].DefaultValue, true);
605 end
606 end
607end, 5);
608Options('LoadSettings', 'Load Settings', Load, 4);
609Options('SaveSettings', 'Save Settings', function()
610 local COptions = {};
611
612 for i, v in pairs(Options) do
613 COptions[i] = v;
614 end
615
616 if typeof(COptions.TeamColor) == 'Color3' then COptions.TeamColor = { R = COptions.TeamColor.R; G = COptions.TeamColor.G; B = COptions.TeamColor.B } end
617 if typeof(COptions.EnemyColor) == 'Color3' then COptions.EnemyColor = { R = COptions.EnemyColor.R; G = COptions.EnemyColor.G; B = COptions.EnemyColor.B } end
618
619 if typeof(COptions.MenuKey.Value) == 'EnumItem' then COptions.MenuKey = COptions.MenuKey.Value.Name end
620 if typeof(COptions.ToggleKey.Value) == 'EnumItem' then COptions.ToggleKey = COptions.ToggleKey.Value.Name end
621
622 writefile(OptionsFile, HttpService:JSONEncode(COptions));
623end, 3);
624
625Load(1);
626
627Options('MenuOpen', nil, true);
628
629local function Combine(...)
630 local Output = {};
631 for i, v in pairs{...} do
632 if typeof(v) == 'table' then
633 table.foreach(v, function(i, v)
634 Output[i] = v;
635 end)
636 end
637 end
638 return Output
639end
640
641function LineBox:Create(Properties)
642 local Box = { Visible = true }; -- prevent errors not really though dont worry bout the Visible = true thing
643
644 local Properties = Combine({
645 Transparency = 1;
646 Thickness = 3;
647 Visible = true;
648 }, Properties);
649
650 if syn then
651 Box['Quad'] = NewDrawing'Quad'(Properties);
652 else
653 Box['TopLeft'] = NewDrawing'Line'(Properties);
654 Box['TopRight'] = NewDrawing'Line'(Properties);
655 Box['BottomLeft'] = NewDrawing'Line'(Properties);
656 Box['BottomRight'] = NewDrawing'Line'(Properties);
657 end
658
659 function Box:Update(CF, Size, Color, Properties)
660 if not CF or not Size then return end
661
662 local TLPos, Visible1 = WorldToViewport((CF * CFrame.new( Size.X, Size.Y, 0)).Position);
663 local TRPos, Visible2 = WorldToViewport((CF * CFrame.new(-Size.X, Size.Y, 0)).Position);
664 local BLPos, Visible3 = WorldToViewport((CF * CFrame.new( Size.X, -Size.Y, 0)).Position);
665 local BRPos, Visible4 = WorldToViewport((CF * CFrame.new(-Size.X, -Size.Y, 0)).Position);
666
667 local Quad = Box['Quad'];
668
669 if syn then
670 if Visible1 and Visible2 and Visible3 and Visible4 then
671 Quad.Visible = true;
672 Quad.Color = Color;
673 Quad.PointA = V2New(TLPos.X, TLPos.Y);
674 Quad.PointB = V2New(TRPos.X, TRPos.Y);
675 Quad.PointC = V2New(BRPos.X, BRPos.Y);
676 Quad.PointD = V2New(BLPos.X, BLPos.Y);
677 else
678 Box['Quad'].Visible = false;
679 end
680 else
681 Visible1 = TLPos.Z > 0 -- (commented | reason: random flashes);
682 Visible2 = TRPos.Z > 0 -- (commented | reason: random flashes);
683 Visible3 = BLPos.Z > 0 -- (commented | reason: random flashes);
684 Visible4 = BRPos.Z > 0 -- (commented | reason: random flashes);
685
686 -- ## BEGIN UGLY CODE
687 if Visible1 then
688 Box['TopLeft'].Visible = true;
689 Box['TopLeft'].Color = Color;
690 Box['TopLeft'].From = V2New(TLPos.X, TLPos.Y);
691 Box['TopLeft'].To = V2New(TRPos.X, TRPos.Y);
692 else
693 Box['TopLeft'].Visible = false;
694 end
695 if Visible2 then
696 Box['TopRight'].Visible = true;
697 Box['TopRight'].Color = Color;
698 Box['TopRight'].From = V2New(TRPos.X, TRPos.Y);
699 Box['TopRight'].To = V2New(BRPos.X, BRPos.Y);
700 else
701 Box['TopRight'].Visible = false;
702 end
703 if Visible3 then
704 Box['BottomLeft'].Visible = true;
705 Box['BottomLeft'].Color = Color;
706 Box['BottomLeft'].From = V2New(BLPos.X, BLPos.Y);
707 Box['BottomLeft'].To = V2New(TLPos.X, TLPos.Y);
708 else
709 Box['BottomLeft'].Visible = false;
710 end
711 if Visible4 then
712 Box['BottomRight'].Visible = true;
713 Box['BottomRight'].Color = Color;
714 Box['BottomRight'].From = V2New(BRPos.X, BRPos.Y);
715 Box['BottomRight'].To = V2New(BLPos.X, BLPos.Y);
716 else
717 Box['BottomRight'].Visible = false;
718 end
719 -- ## END UGLY CODE
720 if Properties and typeof(Properties) == 'table' then
721 GetTableData(Properties)(function(i, v)
722 pcall(Set, Box['TopLeft'], i, v);
723 pcall(Set, Box['TopRight'], i, v);
724 pcall(Set, Box['BottomLeft'], i, v);
725 pcall(Set, Box['BottomRight'], i, v);
726 end)
727 end
728 end
729 end
730 function Box:SetVisible(bool)
731 pcall(Set, Box['Quad'], 'Visible', bool);
732 -- pcall(Set, Box['TopLeft'], 'Visible', bool);
733 -- pcall(Set, Box['TopRight'], 'Visible', bool);
734 -- pcall(Set, Box['BottomLeft'], 'Visible', bool);
735 -- pcall(Set, Box['BottomRight'], 'Visible', bool);
736 end
737 function Box:Remove()
738 self:SetVisible(false);
739 Box['Quad']:Remove();
740 -- Box['TopLeft']:Remove();
741 -- Box['TopRight']:Remove();
742 -- Box['BottomLeft']:Remove();
743 -- Box['BottomRight']:Remove();
744 end
745
746 return Box;
747end
748
749local Colors = {
750 White = FromHex'ffffff';
751 Primary = {
752 Main = FromHex'424242';
753 Light = FromHex'6d6d6d';
754 Dark = FromHex'1b1b1b';
755 };
756 Secondary = {
757 Main = FromHex'e0e0e0';
758 Light = FromHex'ffffff';
759 Dark = FromHex'aeaeae';
760 };
761};
762
763function Connections:Listen(Connection, Function)
764 local NewConnection = Connection:Connect(Function);
765 table.insert(self.Active, NewConnection);
766 return NewConnection;
767end
768
769function Connections:DisconnectAll()
770 for Index, Connection in pairs(self.Active) do
771 if Connection.Connected then
772 Connection:Disconnect();
773 end
774 end
775
776 self.Active = {};
777end
778
779function Signal.new()
780 local self = setmetatable({ _BindableEvent = Instance.new'BindableEvent' }, Signal);
781
782 return self;
783end
784
785function Signal:Connect(Callback)
786 assert(typeof(Callback) == 'function', 'function expected; got ' .. typeof(Callback));
787
788 return self._BindableEvent.Event:Connect(function(...) Callback(...) end);
789end
790
791function Signal:Fire(...)
792 self._BindableEvent:Fire(...);
793end
794
795function Signal:Wait()
796 local Arguments = self._BindableEvent:Wait();
797
798 return Arguments;
799end
800
801function Signal:Disconnect()
802 if self._BindableEvent then
803 self._BindableEvent:Destroy();
804 end
805end
806
807local function GetMouseLocation()
808 return UserInputService:GetMouseLocation();
809end
810
811local function IsMouseOverDrawing(Drawing, MousePosition)
812 local TopLeft = Drawing.Position;
813 local BottomRight = Drawing.Position + Drawing.Size;
814 local MousePosition = MousePosition or GetMouseLocation();
815
816 return MousePosition.X > TopLeft.X and MousePosition.Y > TopLeft.Y and MousePosition.X < BottomRight.X and MousePosition.Y < BottomRight.Y;
817end
818
819local ImageCache = {};
820
821local function SetImage(Drawing, Url)
822 local Data = IsSynapse and game:HttpGet(Url) or Url;
823
824 Drawing[IsSynapse and 'Data' or 'Uri'] = ImageCache[Url] or Data;
825 ImageCache[Url] = Data;
826
827 if not IsSynapse then repeat wait() until Drawing.Loaded; end
828end
829
830-- oh god unnamed esp needs an entire rewrite, someone make a better one pls im too lazy
831-- btw the color picker was made seperately so it doesnt fit with the code of unnamed esp
832
833local function CreateDrawingsTable()
834 local Drawings = { __Objects = {} };
835 local Metatable = {};
836
837 function Metatable.__index(self, Index)
838 local Object = rawget(self.__Objects, Index);
839
840 if not Object or (IsSynapse and not Object.__SELF.__OBJECT_EXISTS) then
841 local Type = Index:sub(1, Index:find'-' - 1);
842
843 Success, Object = pcall(Drawing.new, Type);
844
845 if not Object or not Success then return function() end; end
846
847 self.__Objects[Index] = setmetatable({ __SELF = Object; Type = Type }, {
848 __call = function(self, Properties)
849 local Object = rawget(self, '__SELF'); if IsSynapse and not Object.__OBJECT_EXISTS then return false, 'render object destroyed'; end
850
851 if Properties == false then
852 Object.Visible = false;
853 Object.Transparency = 0;
854 Object:Remove();
855
856 return true;
857 end
858
859 if typeof(Properties) == 'table' then
860 for Property, Value in pairs(Properties) do
861 local CanSet = true;
862
863 if self.Type == 'Image' and not IsSynapse and Property == 'Size' and typeof(Value) == 'Vector2' then
864 CanSet = false;
865
866 spawn(function()
867 repeat wait() until Object.Loaded;
868 if not self.DefaultSize then rawset(self, 'DefaultSize', Object.Size) end
869
870 Property = 'ScaleFactor';
871 Value = Value.X / self.DefaultSize.X;
872
873 Object[Property] = Value
874 end)
875 end
876
877 if CanSet then Object[Property] = Value end
878 end
879 end
880
881 return Object;
882 end
883 });
884
885 Object.Visible = true;
886 Object.Transparency = 1; -- Transparency is really Opacity with drawing api (1 being visible, 0 being invisible)
887
888 if Type == 'Text' then
889 if Drawing.Fonts then Object.Font = Drawing.Fonts.Monospace end
890 Object.Size = 20;
891 Object.Color = Color3.new(1, 1, 1);
892 Object.Center = true;
893 Object.Outline = true;
894 elseif Type == 'Square' or Type == 'Rectangle' then
895 Object.Thickness = 2;
896 Object.Filled = false;
897 end
898
899 return self.__Objects[Index];
900 end
901
902 return Object;
903 end
904
905 function Metatable.__call(self, Delete, ...)
906 local Arguments = {Delete, ...};
907
908 if Delete == false then
909 for Index, Drawing in pairs(rawget(self, '__Objects')) do
910 Drawing(false);
911 end
912 end
913 end
914
915 return setmetatable(Drawings, Metatable);
916end
917
918local Images = {};
919
920spawn(function()
921 Images.Ring = 'https://i.imgur.com/q4qx26f.png';
922 Images.Overlay = 'https://i.imgur.com/gOCxbsR.png';
923end)
924
925function ColorPicker.new(Position, Size, Color)
926 ColorPicker.LastGenerated = tick();
927 ColorPicker.Loading = true;
928
929 local Picker = { Color = Color or Color3.new(1, 1, 1); HSV = { H = 0, S = 1, V = 1 } };
930 local Drawings = CreateDrawingsTable();
931 local Position = Position or V2New();
932 local Size = Size or 150;
933 local Padding = { 10, 10, 10, 10 };
934
935 Picker.ColorChanged = Signal.new();
936
937 local Background = Drawings['Square-Background'] {
938 Color = Color3.fromRGB(33, 33, 33);
939 Filled = false;
940 Visible = false;
941 Position = Position - V2New(Padding[4], Padding[1]);
942 Size = V2New(Size, Size) + V2New(Padding[4] + Padding[2], Padding[1] + Padding[3]);
943 };
944 local ColorPreview = Drawings['Circle-Preview'] {
945 Position = Position + (V2New(Size, Size) / 2);
946 Radius = Size / 2 - 8;
947 Filled = true;
948 Thickness = 0;
949 NumSides = 20;
950 Color = Color3.new(1, 0, 0);
951 };
952 local Main = Drawings['Image-Main'] {
953 Position = Position;
954 Size = V2New(Size, Size);
955 }; SetImage(Main, Images.Ring);
956 local Preview = Drawings['Square-Preview'] {
957 Position = Main.Position + (Main.Size / 4.5);
958 Size = Main.Size / 1.75;
959 Color = Color3.new(1, 0, 0);
960 Filled = true;
961 Thickness = 0;
962 };
963 local Overlay = Drawings['Image-Overlay'] {
964 Position = Preview.Position;
965 Size = Preview.Size;
966 Transparency = 1;
967 }; SetImage(Overlay, Images.Overlay);
968 local CursorOutline = Drawings['Circle-CursorOutline'] {
969 Radius = 4;
970 Thickness = 2;
971 Filled = false;
972 Color = Color3.new(0.2, 0.2, 0.2);
973 Position = V2New(Main.Position.X + Main.Size.X - 10, Main.Position.Y + (Main.Size.Y / 2));
974 };
975 local Cursor = Drawings['Circle-Cursor'] {
976 Radius = 3;
977 Transparency = 1;
978 Filled = true;
979 Color = Color3.new(1, 1, 1);
980 Position = CursorOutline.Position;
981 };
982 local CursorOutline = Drawings['Circle-CursorOutlineSquare'] {
983 Radius = 4;
984 Thickness = 2;
985 Filled = false;
986 Color = Color3.new(0.2, 0.2, 0.2);
987 Position = V2New(Preview.Position.X + Preview.Size.X - 2, Preview.Position.Y + 2);
988 };
989 Drawings['Circle-CursorSquare'] {
990 Radius = 3;
991 Transparency = 1;
992 Filled = true;
993 Color = Color3.new(1, 1, 1);
994 Position = CursorOutline.Position;
995 };
996
997 function Picker:UpdatePosition(Input)
998 local MousePosition = V2New(Input.Position.X, Input.Position.Y + 33);
999
1000 if self.MouseHeld then
1001 if self.Item == 'Ring' then
1002 local Main = self.Drawings['Image-Main'] ();
1003 local Preview = self.Drawings['Square-Preview'] ();
1004 local Bounds = Main.Size / 2;
1005 local Center = Main.Position + Bounds;
1006 local Relative = MousePosition - Center;
1007 local Direction = Relative.unit;
1008 local Position = Center + Direction * Main.Size.X / 2.15;
1009 local H = (math.atan2(Position.Y - Center.Y, Position.X - Center.X)) * 60;
1010 if H < 0 then H = 360 + H; end
1011 H = H / 360;
1012 self.HSV.H = H;
1013 local EndColor = Color3.fromHSV(H, self.HSV.S, self.HSV.V); if EndColor ~= self.Color then self.ColorChanged:Fire(self.Color); end
1014 local Pointer = self.Drawings['Circle-Cursor'] { Position = Position };
1015 self.Drawings['Circle-CursorOutline'] { Position = Pointer.Position };
1016 Bounds = Bounds * 2;
1017 Preview.Color = Color3.fromHSV(H, 1, 1);
1018 self.Color = EndColor;
1019 self.Drawings['Circle-Preview'] { Color = EndColor };
1020 elseif self.Item == 'HL' then
1021 local Preview = self.Drawings['Square-Preview'] ();
1022 local HSV = self.HSV;
1023 local Position = V2New(math.clamp(MousePosition.X, Preview.Position.X, Preview.Position.X + Preview.Size.X), math.clamp(MousePosition.Y, Preview.Position.Y, Preview.Position.Y + Preview.Size.Y));
1024 HSV.S = (Position.X - Preview.Position.X) / Preview.Size.X;
1025 HSV.V = 1 - (Position.Y - Preview.Position.Y) / Preview.Size.Y;
1026 local EndColor = Color3.fromHSV(HSV.H, HSV.S, HSV.V); if EndColor ~= self.Color then self.ColorChanged:Fire(self.Color); end
1027 self.Color = EndColor;
1028 self.Drawings['Circle-Preview'] { Color = EndColor };
1029 local Pointer = self.Drawings['Circle-CursorSquare'] { Position = Position };
1030 self.Drawings['Circle-CursorOutlineSquare'] { Position = Pointer.Position };
1031 end
1032 end
1033 end
1034
1035 function Picker:HandleInput(Input, P, Type)
1036 if Type == 'Began' then
1037 if Input.UserInputType.Name == 'MouseButton1' then
1038 local Main = self.Drawings['Image-Main'] ();
1039 local SquareSV = self.Drawings['Square-Preview'] ();
1040 local MousePosition = V2New(Input.Position.X, Input.Position.Y + 33);
1041 self.MouseHeld = true;
1042 local Bounds = Main.Size / 2;
1043 local Center = Main.Position + Bounds;
1044 local R = (MousePosition - Center);
1045
1046 if R.Magnitude < Bounds.X and R.Magnitude > Bounds.X - 20 then
1047 self.Item = 'Ring';
1048 end
1049
1050 if MousePosition.X > SquareSV.Position.X and MousePosition.Y > SquareSV.Position.Y and MousePosition.X < SquareSV.Position.X + SquareSV.Size.X and MousePosition.Y < SquareSV.Position.Y + SquareSV.Size.Y then
1051 self.Item = 'HL';
1052 end
1053
1054 self:UpdatePosition(Input, P);
1055 end
1056 elseif Type == 'Changed' then
1057 if Input.UserInputType.Name == 'MouseMovement' then
1058 self:UpdatePosition(Input, P);
1059 end
1060 elseif Type == 'Ended' and Input.UserInputType.Name == 'MouseButton1' then
1061 self.Item = nil;
1062 end
1063 end
1064
1065 function Picker:Dispose()
1066 self.Drawings(false);
1067 self.UpdatePosition = nil;
1068 self.HandleInput = nil;
1069 Connections:DisconnectAll(); -- scuffed tbh
1070 end
1071
1072 Connections:Listen(UserInputService.InputBegan, function(Input, Process)
1073 Picker:HandleInput(Input, Process, 'Began');
1074 end);
1075 Connections:Listen(UserInputService.InputChanged, function(Input, Process)
1076 if Input.UserInputType.Name == 'MouseMovement' then
1077 local MousePosition = V2New(Input.Position.X, Input.Position.Y + 33);
1078 local Cursor = Picker.Drawings['Triangle-Cursor'] {
1079 Filled = true;
1080 Color = Color3.new(0.9, 0.9, 0.9);
1081 PointA = MousePosition + V2New(0, 0);
1082 PointB = MousePosition + V2New(12, 14);
1083 PointC = MousePosition + V2New(0, 18);
1084 Thickness = 0;
1085 };
1086 end
1087 Picker:HandleInput(Input, Process, 'Changed');
1088 end);
1089 Connections:Listen(UserInputService.InputEnded, function(Input, Process)
1090 Picker:HandleInput(Input, Process, 'Ended');
1091
1092 if Input.UserInputType.Name == 'MouseButton1' then
1093 Picker.MouseHeld = false;
1094 end
1095 end);
1096
1097 ColorPicker.Loading = false;
1098
1099 Picker.Drawings = Drawings;
1100 return Picker;
1101end
1102
1103function SubMenu:Show(Position, Title, Options)
1104 self.Open = true;
1105
1106 local Visible = true;
1107 local BasePosition = Position;
1108 local BaseSize = V2New(200, 140);
1109 local End = BasePosition + BaseSize;
1110
1111 self.Bounds = { BasePosition.X, BasePosition.Y, End.X, End.Y };
1112
1113 delay(.025, function()
1114 if not self.Open then return; end
1115
1116 Menu:AddMenuInstance('Sub-Main', 'Square', {
1117 Size = BaseSize;
1118 Position = BasePosition;
1119 Filled = false;
1120 Color = Colors.Primary.Main;
1121 Thickness = 3;
1122 Visible = Visible;
1123 });
1124 end);
1125 Menu:AddMenuInstance('Sub-TopBar', 'Square', {
1126 Position = BasePosition;
1127 Size = V2New(BaseSize.X, 10);
1128 Color = Colors.Primary.Dark;
1129 Filled = true;
1130 Visible = Visible;
1131 });
1132 Menu:AddMenuInstance('Sub-TopBarTwo', 'Square', {
1133 Position = BasePosition + V2New(0, 10);
1134 Size = V2New(BaseSize.X, 20);
1135 Color = Colors.Primary.Main;
1136 Filled = true;
1137 Visible = Visible;
1138 });
1139 Menu:AddMenuInstance('Sub-TopBarText', 'Text', {
1140 Size = 20;
1141 Position = shared.MenuDrawingData.Instances['Sub-TopBarTwo'].Position + V2New(15, -3);
1142 Text = Title or '';
1143 Color = Colors.Secondary.Light;
1144 Visible = Visible;
1145 });
1146 Menu:AddMenuInstance('Sub-Filling', 'Square', {
1147 Size = BaseSize - V2New(0, 30);
1148 Position = BasePosition + V2New(0, 30);
1149 Filled = true;
1150 Color = Colors.Secondary.Main;
1151 Transparency= .75;
1152 Visible = Visible;
1153 });
1154
1155 if Options then
1156 for Index, Option in pairs(Options) do -- currently only supports color and button(but color is a button so), planning on fully rewriting or something
1157 local function GetName(Name) return ('Sub-%s.%d'):format(Name, Index) end
1158 local Position = shared.MenuDrawingData.Instances['Sub-Filling'].Position + V2New(20, Index * 25 - 10);
1159 -- local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + V2New(30, v.Index * 25 - 10);
1160
1161 if Option.Type == 'Color' then
1162 local ColorPreview = Menu:AddMenuInstance(GetName'ColorPreview', 'Circle', {
1163 Position = Position;
1164 Color = Option.Color;
1165 Radius = IsSynapse and 10 or 10;
1166 NumSides = 10;
1167 Filled = true;
1168 Visible = true;
1169 });
1170 local Text = Menu:AddMenuInstance(GetName'Text', 'Text', {
1171 Text = Option.Text;
1172 Position = ColorPreview.Position + V2New(15, -8);
1173 Size = 16;
1174 Color = Colors.Primary.Dark;
1175 Visible = true;
1176 });
1177 UIButtons[#UIButtons + 1] = {
1178 FromSubMenu = true;
1179 Option = function() return Option.Function(ColorPreview, BasePosition + V2New(BaseSize.X, 0)) end;
1180 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', GetName'Button'), 'Square', {
1181 Position = Position - V2New(20, 12);
1182 Size = V2New(BaseSize.X, 25);
1183 Visible = false;
1184 });
1185 };
1186 elseif Option.Type == 'Button' then
1187 UIButtons[#UIButtons + 1] = {
1188 FromSubMenu = true;
1189 Option = Option.Function;
1190 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', GetName'Button'), 'Square', {
1191 Size = V2New(BaseSize.X, 20) - V2New(20, 0);
1192 Visible = true;
1193 Transparency= .5;
1194 Position = Position - V2New(10, 10);
1195 Color = Colors.Secondary.Light;
1196 Filled = true;
1197 });
1198 };
1199 local Text = Menu:AddMenuInstance(Format('%s_Text', GetName'Text'), 'Text', {
1200 Text = Option.Text;
1201 Size = 18;
1202 Position = Position + V2New(5, -10);
1203 Visible = true;
1204 Color = Colors.Primary.Dark;
1205 });
1206 end
1207 end
1208 end
1209end
1210
1211function SubMenu:Hide()
1212 self.Open = false;
1213
1214 for i, v in pairs(shared.MenuDrawingData.Instances) do
1215 if i:sub(1, 3) == 'Sub' then
1216 v.Visible = false;
1217
1218 if i:sub(4, 4) == ':' then -- ';' = Temporary so remove
1219 v:Remove();
1220 shared.MenuDrawingData.Instance[i] = nil;
1221 end
1222 end
1223 end
1224
1225 for i, Button in pairs(UIButtons) do
1226 if Button.FromSubMenu then
1227 UIButtons[i] = nil;
1228 end
1229 end
1230
1231 spawn(function() -- stupid bug happens if i dont use this
1232 for i = 1, 10 do
1233 if shared.CurrentColorPicker then -- dont know why 'CurrentColorPicker' isnt a variable in this
1234 shared.CurrentColorPicker:Dispose();
1235 end
1236 wait(0.1);
1237 end
1238 end)
1239
1240 CurrentColorPicker = nil;
1241end
1242
1243function CreateMenu(NewPosition) -- Create Menu
1244 MenuLoaded = false;
1245 UIButtons = {};
1246 Sliders = {};
1247
1248 local BaseSize = V2New(300, 625);
1249 local BasePosition = NewPosition or V2New(Camera.ViewportSize.X / 8 - (BaseSize.X / 2), Camera.ViewportSize.Y / 2 - (BaseSize.Y / 2));
1250
1251 BasePosition = V2New(math.clamp(BasePosition.X, 0, Camera.ViewportSize.X), math.clamp(BasePosition.Y, 0, Camera.ViewportSize.Y));
1252
1253 Menu:AddMenuInstance('CrosshairX', 'Line', {
1254 Visible = false;
1255 Color = Color3.new(0, 1, 0);
1256 Transparency = 1;
1257 Thickness = 1;
1258 });
1259 Menu:AddMenuInstance('CrosshairY', 'Line', {
1260 Visible = false;
1261 Color = Color3.new(0, 1, 0);
1262 Transparency = 1;
1263 Thickness = 1;
1264 });
1265
1266 delay(.025, function() -- since zindex doesnt exist
1267 Menu:AddMenuInstance('Main', 'Square', {
1268 Size = BaseSize;
1269 Position = BasePosition;
1270 Filled = false;
1271 Color = Colors.Primary.Main;
1272 Thickness = 3;
1273 Visible = true;
1274 });
1275 end);
1276 Menu:AddMenuInstance('TopBar', 'Square', {
1277 Position = BasePosition;
1278 Size = V2New(BaseSize.X, 15);
1279 Color = Colors.Primary.Dark;
1280 Filled = true;
1281 Visible = true;
1282 });
1283 Menu:AddMenuInstance('TopBarTwo', 'Square', {
1284 Position = BasePosition + V2New(0, 15);
1285 Size = V2New(BaseSize.X, 45);
1286 Color = Colors.Primary.Main;
1287 Filled = true;
1288 Visible = true;
1289 });
1290 Menu:AddMenuInstance('TopBarText', 'Text', {
1291 Size = 25;
1292 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + V2New(25, 10);
1293 Text = '10x Hub ESP';
1294 Color = Colors.Secondary.Light;
1295 Visible = true;
1296 Transparency= 1; -- proto outline fix
1297 Outline = true;
1298 });
1299 Menu:AddMenuInstance('TopBarTextBR', 'Text', {
1300 Size = 18;
1301 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + V2New(BaseSize.X - 75, 25);
1302 Text = 'By 10x00';
1303 Color = Colors.Secondary.Light;
1304 Visible = true;
1305 Transparency= 1;
1306 Outline = true;
1307 });
1308 Menu:AddMenuInstance('Filling', 'Square', {
1309 Size = BaseSize - V2New(0, 60);
1310 Position = BasePosition + V2New(0, 60);
1311 Filled = true;
1312 Color = Colors.Secondary.Main;
1313 Transparency= .5;
1314 Visible = true;
1315 });
1316
1317 local CPos = 0;
1318
1319 GetTableData(Options)(function(i, v)
1320 if typeof(v.Value) == 'boolean' and not IsStringEmpty(v.Text) and v.Text ~= nil then
1321 CPos = CPos + 25;
1322 local BaseSize = V2New(BaseSize.X, 30);
1323 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + V2New(30, v.Index * 25 - 10);
1324 UIButtons[#UIButtons + 1] = {
1325 Option = v;
1326 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1327 Position = BasePosition - V2New(30, 15);
1328 Size = BaseSize;
1329 Visible = false;
1330 });
1331 };
1332 Menu:AddMenuInstance(Format('%s_OuterCircle', v.Name), 'Circle', {
1333 Radius = 10;
1334 Position = BasePosition;
1335 Color = Colors.Secondary.Light;
1336 Filled = true;
1337 Visible = true;
1338 });
1339 Menu:AddMenuInstance(Format('%s_InnerCircle', v.Name), 'Circle', {
1340 Radius = 7;
1341 Position = BasePosition;
1342 Color = Colors.Secondary.Dark;
1343 Filled = true;
1344 Visible = v.Value;
1345 });
1346 Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1347 Text = v.Text;
1348 Size = 20;
1349 Position = BasePosition + V2New(20, -10);
1350 Visible = true;
1351 Color = Colors.Secondary.Light;
1352 Transparency= 1;
1353 Outline = true;
1354 });
1355 end
1356 end)
1357 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1358 if typeof(v.Value) == 'number' then
1359 CPos = CPos + 25;
1360
1361 local BaseSize = V2New(BaseSize.X, 30);
1362 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + V2New(0, CPos - 10);
1363
1364 local Line = Menu:AddMenuInstance(Format('%s_SliderLine', v.Name), 'Square', {
1365 Transparency = 1;
1366 Color = Colors.Secondary.Light;
1367 -- Thickness = 3;
1368 Filled = true;
1369 Visible = true;
1370 Position = BasePosition + V2New(15, -5);
1371 Size = BaseSize - V2New(30, 10);
1372 Transparency = 0.5;
1373 });
1374 local Slider = Menu:AddMenuInstance(Format('%s_Slider', v.Name), 'Square', {
1375 Visible = true;
1376 Filled = true;
1377 Color = Colors.Primary.Dark;
1378 Size = V2New(5, Line.Size.Y);
1379 Transparency = 0.5;
1380 });
1381 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1382 Text = v.Text;
1383 Size = 20;
1384 Center = true;
1385 Transparency = 1;
1386 Outline = true;
1387 Visible = true;
1388 Color = Colors.White;
1389 }); Text.Position = Line.Position + (Line.Size / 2) - V2New(0, Text.TextBounds.Y / 1.75);
1390 local AMT = Menu:AddMenuInstance(Format('%s_AmountText', v.Name), 'Text', {
1391 Text = tostring(v.Value);
1392 Size = 22;
1393 Center = true;
1394 Transparency = 1;
1395 Outline = true;
1396 Visible = true;
1397 Color = Colors.White;
1398 Position = Text.Position;
1399 });
1400
1401 local CSlider = {Slider = Slider; Line = Line; Min = v.AllArgs[4]; Max = v.AllArgs[5]; Option = v};
1402 local Dummy = Instance.new'NumberValue';
1403
1404 Dummy:GetPropertyChangedSignal'Value':Connect(function()
1405 Text.Transparency = Dummy.Value;
1406 AMT.Transparency = 1 - Dummy.Value;
1407 end);
1408
1409 Dummy.Value = 1;
1410
1411 function CSlider:ShowValue(Bool)
1412 self.ShowingValue = Bool;
1413
1414 TweenService:Create(Dummy, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Value = Bool and 0 or 1 }):Play();
1415 end
1416
1417 Sliders[#Sliders + 1] = CSlider;
1418
1419 -- local Percent = (v.Value / CSlider.Max) * 100;
1420 -- local Size = math.abs(Line.From.X - Line.To.X);
1421 -- local Value = Size * (Percent / 100); -- this shit's inaccurate but fuck it i'm not even gonna bother fixing it
1422
1423 Slider.Position = Line.Position + V2New(35, 0);
1424
1425 v.BaseSize = BaseSize;
1426 v.BasePosition = BasePosition;
1427 -- AMT.Position = BasePosition + V2New(BaseSize.X - AMT.TextBounds.X - 10, -10)
1428 end
1429 end)
1430 local FirstItem = false;
1431 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1432 if typeof(v.Value) == 'EnumItem' then
1433 CPos = CPos + (not FirstItem and 30 or 25);
1434 FirstItem = true;
1435
1436 local BaseSize = V2New(BaseSize.X, FirstItem and 30 or 25);
1437 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + V2New(0, CPos - 10);
1438
1439 UIButtons[#UIButtons + 1] = {
1440 Option = v;
1441 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1442 Size = V2New(BaseSize.X, 20) - V2New(30, 0);
1443 Visible = true;
1444 Transparency= .5;
1445 Position = BasePosition + V2New(15, -10);
1446 Color = Colors.Secondary.Light;
1447 Filled = true;
1448 });
1449 };
1450 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1451 Text = v.Text;
1452 Size = 20;
1453 Position = BasePosition + V2New(20, -10);
1454 Visible = true;
1455 Color = Colors.Secondary.Light;
1456 Transparency= 1;
1457 Outline = true;
1458 });
1459 local BindText = Menu:AddMenuInstance(Format('%s_BindText', v.Name), 'Text', {
1460 Text = tostring(v.Value):match'%w+%.%w+%.(.+)';
1461 Size = 20;
1462 Position = BasePosition;
1463 Visible = true;
1464 Color = Colors.Secondary.Light;
1465 Transparency= 1;
1466 Outline = true;
1467 });
1468
1469 Options[i].BaseSize = BaseSize;
1470 Options[i].BasePosition = BasePosition;
1471 BindText.Position = BasePosition + V2New(BaseSize.X - BindText.TextBounds.X - 20, -10);
1472 end
1473 end)
1474 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1475 if typeof(v.Value) == 'function' then
1476 local BaseSize = V2New(BaseSize.X, 30);
1477 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + V2New(0, CPos + (25 * v.AllArgs[4]) - 35);
1478
1479 UIButtons[#UIButtons + 1] = {
1480 Option = v;
1481 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1482 Size = V2New(BaseSize.X, 20) - V2New(30, 0);
1483 Visible = true;
1484 Transparency= .5;
1485 Position = BasePosition + V2New(15, -10);
1486 Color = Colors.Secondary.Light;
1487 Filled = true;
1488 });
1489 };
1490 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1491 Text = v.Text;
1492 Size = 20;
1493 Position = BasePosition + V2New(20, -10);
1494 Visible = true;
1495 Color = Colors.Secondary.Light;
1496 Transparency= 1;
1497 Outline = true;
1498 });
1499
1500 -- BindText.Position = BasePosition + V2New(BaseSize.X - BindText.TextBounds.X - 10, -10);
1501 end
1502 end)
1503
1504 delay(.1, function()
1505 MenuLoaded = true;
1506 end);
1507
1508 -- this has to be at the bottom cuz proto drawing api doesnt have zindex :triumph:
1509 Menu:AddMenuInstance('Cursor1', 'Line', {
1510 Visible = false;
1511 Color = Color3.new(1, 0, 0);
1512 Transparency = 1;
1513 Thickness = 2;
1514 });
1515 Menu:AddMenuInstance('Cursor2', 'Line', {
1516 Visible = false;
1517 Color = Color3.new(1, 0, 0);
1518 Transparency = 1;
1519 Thickness = 2;
1520 });
1521 Menu:AddMenuInstance('Cursor3', 'Line', {
1522 Visible = false;
1523 Color = Color3.new(1, 0, 0);
1524 Transparency = 1;
1525 Thickness = 2;
1526 });
1527end
1528
1529CreateMenu();
1530delay(0.1, function()
1531 SubMenu:Show(V2New()); -- Create the submenu
1532 SubMenu:Hide();
1533end);
1534
1535shared.UESP_InputChangedCon = UserInputService.InputChanged:Connect(function(input)
1536 if input.UserInputType.Name == 'MouseMovement' and Options.MenuOpen.Value then
1537 for i, v in pairs(Sliders) do
1538 local Values = {
1539 v.Line.Position.X;
1540 v.Line.Position.Y;
1541 v.Line.Position.X + v.Line.Size.X;
1542 v.Line.Position.Y + v.Line.Size.Y;
1543 };
1544 if MouseHoveringOver(Values) then
1545 v:ShowValue(true);
1546 else
1547 if not MouseHeld then v:ShowValue(false); end
1548 end
1549 end
1550 end
1551end)
1552shared.UESP_InputBeganCon = UserInputService.InputBegan:Connect(function(input)
1553 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
1554 MouseHeld = true;
1555 local Bar = Menu:GetInstance'TopBar';
1556 local Values = {
1557 Bar.Position.X;
1558 Bar.Position.Y;
1559 Bar.Position.X + Bar.Size.X;
1560 Bar.Position.Y + Bar.Size.Y;
1561 }
1562 if MouseHoveringOver(Values) then
1563 DraggingUI = true;
1564 DragOffset = Menu:GetInstance'Main'.Position - GetMouseLocation();
1565 else
1566 for i, v in pairs(Sliders) do
1567 local Values = {
1568 v.Line.Position.X;
1569 v.Line.Position.Y;
1570 v.Line.Position.X + v.Line.Size.X;
1571 v.Line.Position.Y + v.Line.Size.Y;
1572 -- v.Line.From.X - (v.Slider.Radius);
1573 -- v.Line.From.Y - (v.Slider.Radius);
1574 -- v.Line.To.X + (v.Slider.Radius);
1575 -- v.Line.To.Y + (v.Slider.Radius);
1576 };
1577 if MouseHoveringOver(Values) then
1578 DraggingWhat = v;
1579 Dragging = true;
1580 break
1581 end
1582 end
1583
1584 if not Dragging then
1585 local Values = {
1586 TracerPosition.X - 10;
1587 TracerPosition.Y - 10;
1588 TracerPosition.X + 10;
1589 TracerPosition.Y + 10;
1590 };
1591 if MouseHoveringOver(Values) then
1592 DragTracerPosition = true;
1593 end
1594 end
1595 end
1596 end
1597end)
1598shared.UESP_InputEndedCon = UserInputService.InputEnded:Connect(function(input)
1599 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
1600 MouseHeld = false;
1601 DragTracerPosition = false;
1602 local IgnoreOtherInput = false;
1603
1604 if SubMenu.Open and not MouseHoveringOver(SubMenu.Bounds) then
1605 if CurrentColorPicker and IsMouseOverDrawing(CurrentColorPicker.Drawings['Square-Background']()) then IgnoreOtherInput = true; end
1606 if not IgnoreOtherInput then SubMenu:Hide() end
1607 end
1608
1609 if not IgnoreOtherInput then
1610 for i, v in pairs(UIButtons) do
1611 if SubMenu.Open and MouseHoveringOver(SubMenu.Bounds) and not v.FromSubMenu then continue end
1612
1613 local Values = {
1614 v.Instance.Position.X;
1615 v.Instance.Position.Y;
1616 v.Instance.Position.X + v.Instance.Size.X;
1617 v.Instance.Position.Y + v.Instance.Size.Y;
1618 };
1619 if MouseHoveringOver(Values) then
1620 v.Option();
1621 IgnoreOtherInput = true;
1622 break -- prevent clicking 2 options
1623 end
1624 end
1625 for i, v in pairs(Sliders) do
1626 if IgnoreOtherInput then break end
1627
1628 local Values = {
1629 v.Line.Position.X;
1630 v.Line.Position.Y;
1631 v.Line.Position.X + v.Line.Size.X;
1632 v.Line.Position.Y + v.Line.Size.Y;
1633 };
1634 if not MouseHoveringOver(Values) then
1635 v:ShowValue(false);
1636 end
1637 end
1638 end
1639 elseif input.UserInputType.Name == 'MouseButton2' and Options.MenuOpen.Value and not DragTracerPosition then
1640 local Values = {
1641 TracerPosition.X - 10;
1642 TracerPosition.Y - 10;
1643 TracerPosition.X + 10;
1644 TracerPosition.Y + 10;
1645 }
1646 if MouseHoveringOver(Values) then
1647 DragTracerPosition = false;
1648 TracerPosition = V2New(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y - 135);
1649 end
1650 elseif input.UserInputType.Name == 'Keyboard' then
1651 if Binding then
1652 BindedKey = input.KeyCode;
1653 Binding = false;
1654 elseif input.KeyCode == Options.MenuKey.Value or (input.KeyCode == Enum.KeyCode.Home and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl)) then
1655 Options.MenuOpen();
1656 elseif input.KeyCode == Options.ToggleKey.Value then
1657 Options.Enabled();
1658 elseif input.KeyCode.Name == 'F1' and UserInputService:IsMouseButtonPressed(1) and shared.am_ic3 then -- hehe hiden spectate feature cuz why not
1659 local HD, LPlayer, LCharacter = 0.95;
1660
1661 for i, Player in pairs(Players:GetPlayers()) do
1662 local Character = GetCharacter(Player);
1663
1664 if Player ~= LocalPlayer and Player ~= Spectating and Character and Character:FindFirstChild'HumanoidRootPart' then
1665 local Head = Character:FindFirstChild'Head';
1666 local Humanoid = Character:FindFirstChildOfClass'Humanoid';
1667
1668 if Head then
1669 local Distance = (Camera.CFrame.Position - Head.Position).Magnitude;
1670
1671 if Distance > 2500 then continue; end
1672
1673 local Direction = -(Camera.CFrame.Position - Mouse.Hit.Position).unit;
1674 local Relative = Character.Head.Position - Camera.CFrame.Position;
1675 local Unit = Relative.unit;
1676
1677 local DP = Direction:Dot(Unit);
1678
1679 if DP > HD then
1680 HD = DP;
1681 LPlayer = Player;
1682 LCharacter = Character;
1683 end
1684 end
1685 end
1686 end
1687
1688 if LPlayer and LPlayer ~= Spectating and LCharacter then
1689 Camera.CameraSubject = LCharacter.Head;
1690 Spectating = LPlayer;
1691 else
1692 if LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass'Humanoid' then
1693 Camera.CameraSubject = LocalPlayer.Character:FindFirstChildOfClass'Humanoid';
1694 Spectating = nil;
1695 end
1696 end
1697 end
1698 end
1699end)
1700
1701function ToggleMenu()
1702 if Options.MenuOpen.Value then
1703 -- GUIService:SetMenuIsOpen(true);
1704 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
1705 if OldData[v] then
1706 pcall(Set, v, 'Visible', true);
1707 end
1708 end)
1709 else
1710 -- GUIService:SetMenuIsOpen(false);
1711 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
1712 OldData[v] = v.Visible;
1713 if v.Visible then
1714 pcall(Set, v, 'Visible', false);
1715 end
1716 end)
1717 end
1718end
1719
1720function CheckRay(Instance, Distance, Position, Unit)
1721 local Pass = true;
1722 local Model = Instance;
1723
1724 if Distance > 999 then return false; end
1725
1726 if Instance.ClassName == 'Player' then
1727 Model = GetCharacter(Instance);
1728 end
1729
1730 if not Model then
1731 Model = Instance.Parent;
1732
1733 if Model.Parent == workspace then
1734 Model = Instance;
1735 end
1736 end
1737
1738 if not Model then return false end
1739
1740 local _Ray = Ray.new(Position, Unit * Distance);
1741
1742 local List = {LocalPlayer.Character, Camera, Mouse.TargetFilter};
1743
1744 for i,v in pairs(IgnoreList) do table.insert(List, v); end;
1745
1746 local Hit = workspace:FindPartOnRayWithIgnoreList(_Ray, List);
1747
1748 if Hit and not Hit:IsDescendantOf(Model) then
1749 Pass = false;
1750 if Hit.Transparency >= .3 or not Hit.CanCollide and Hit.ClassName ~= Terrain then -- Detect invisible walls
1751 IgnoreList[#IgnoreList + 1] = Hit;
1752 end
1753 end
1754
1755 return Pass;
1756end
1757
1758function CheckTeam(Player)
1759 if Player.Neutral and LocalPlayer.Neutral then return true; end
1760 return Player.TeamColor == LocalPlayer.TeamColor;
1761end
1762
1763local CustomTeam = CustomTeams[game.PlaceId];
1764
1765if CustomTeam ~= nil then
1766 if CustomTeam.Initialize then ypcall(CustomTeam.Initialize) end
1767
1768 CheckTeam = CustomTeam.CheckTeam;
1769end
1770
1771function CheckPlayer(Player, Character)
1772 if not Options.Enabled.Value then return false end
1773
1774 local Pass = true;
1775 local Distance = 0;
1776
1777 if Player ~= LocalPlayer and Character then
1778 if not Options.ShowTeam.Value and CheckTeam(Player) then
1779 Pass = false;
1780 end
1781
1782 local Head = Character:FindFirstChild'Head';
1783
1784 if Pass and Character and Head then
1785 Distance = (Camera.CFrame.Position - Head.Position).Magnitude;
1786 if Options.VisCheck.Value then
1787 Pass = CheckRay(Player, Distance, Camera.CFrame.Position, (Head.Position - Camera.CFrame.Position).unit);
1788 end
1789 if Distance > Options.MaxDistance.Value then
1790 Pass = false;
1791 end
1792 end
1793 else
1794 Pass = false;
1795 end
1796
1797 return Pass, Distance;
1798end
1799
1800function CheckDistance(Instance)
1801 if not Options.Enabled.Value then return false end
1802
1803 local Pass = true;
1804 local Distance = 0;
1805
1806 if Instance ~= nil then
1807 Distance = (Camera.CFrame.Position - Instance.Position).Magnitude;
1808 if Options.VisCheck.Value then
1809 Pass = CheckRay(Instance, Distance, Camera.CFrame.Position, (Instance.Position - Camera.CFrame.Position).unit);
1810 end
1811 if Distance > Options.MaxDistance.Value then
1812 Pass = false;
1813 end
1814 else
1815 Pass = false;
1816 end
1817
1818 return Pass, Distance;
1819end
1820
1821function UpdatePlayerData()
1822 if (tick() - LastRefresh) > (Options.RefreshRate.Value / 1000) then
1823 LastRefresh = tick();
1824 if CustomESP and Options.Enabled.Value then
1825 local a, b = pcall(CustomESP);
1826 end
1827 for i, v in pairs(RenderList.Instances) do
1828 if v.Instance ~= nil and v.Instance.Parent ~= nil and v.Instance:IsA'BasePart' then
1829 local Data = shared.InstanceData[v.Instance:GetDebugId()] or { Instances = {}; DontDelete = true };
1830
1831 Data.Instance = v.Instance;
1832
1833 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
1834 Transparency = 1;
1835 Thickness = 2;
1836 }
1837 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
1838 Size = Options.TextSize.Value;
1839 Center = true;
1840 Outline = Options.TextOutline.Value;
1841 Visible = true;
1842 };
1843 Data.Instances['DistanceTag'] = Data.Instances['DistanceTag'] or NewDrawing'Text'{
1844 Size = Options.TextSize.Value - 1;
1845 Center = true;
1846 Outline = Options.TextOutline.Value;
1847 Visible = true;
1848 };
1849
1850 local NameTag = Data.Instances['NameTag'];
1851 local DistanceTag = Data.Instances['DistanceTag'];
1852 local Tracer = Data.Instances['Tracer'];
1853
1854 local Pass, Distance = CheckDistance(v.Instance);
1855
1856 if Pass then
1857 local ScreenPosition, Vis = WorldToViewport(v.Instance.Position);
1858 local Color = v.Color;
1859 local OPos = Camera.CFrame:pointToObjectSpace(v.Instance.Position);
1860
1861 if ScreenPosition.Z < 0 then
1862 local AT = math.atan2(OPos.Y, OPos.X) + math.pi;
1863 OPos = CFrame.Angles(0, 0, AT):vectorToWorldSpace((CFrame.Angles(0, math.rad(89.9), 0):vectorToWorldSpace(V3New(0, 0, -1))));
1864 end
1865
1866 local Position = WorldToViewport(Camera.CFrame:pointToWorldSpace(OPos));
1867
1868 if Options.ShowTracers.Value then
1869 Tracer.Transparency = math.clamp(Distance / 200, 0.45, 0.8);
1870 Tracer.Visible = true;
1871 Tracer.From = TracerPosition;
1872 Tracer.To = V2New(Position.X, Position.Y);
1873 Tracer.Color = Color;
1874 else
1875 Tracer.Visible = false;
1876 end
1877
1878 if ScreenPosition.Z > 0 then
1879 local ScreenPositionUpper = ScreenPosition;
1880
1881 if Options.ShowName.Value then
1882 LocalPlayer.NameDisplayDistance = 0;
1883 NameTag.Visible = true;
1884 NameTag.Text = v.Text;
1885 NameTag.Size = Options.TextSize.Value;
1886 NameTag.Outline = Options.TextOutline.Value;
1887 NameTag.Position = V2New(ScreenPositionUpper.X, ScreenPositionUpper.Y);
1888 NameTag.Color = Color;
1889 if Drawing.Fonts and shared.am_ic3 then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1890 NameTag.Font = Drawing.Fonts.Monospace;
1891 end
1892 else
1893 LocalPlayer.NameDisplayDistance = 100;
1894 NameTag.Visible = false;
1895 end
1896 if Options.ShowDistance.Value or Options.ShowHealth.Value then
1897 DistanceTag.Visible = true;
1898 DistanceTag.Size = Options.TextSize.Value - 1;
1899 DistanceTag.Outline = Options.TextOutline.Value;
1900 DistanceTag.Color = Color3.new(1, 1, 1);
1901 if Drawing.Fonts and shared.am_ic3 then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1902 NameTag.Font = Drawing.Fonts.Monospace;
1903 end
1904
1905 local Str = '';
1906
1907 if Options.ShowDistance.Value then
1908 Str = Str .. Format('[%d] ', Distance);
1909 end
1910
1911 DistanceTag.Text = Str;
1912 DistanceTag.Position = V2New(ScreenPositionUpper.X, ScreenPositionUpper.Y) + V2New(0, NameTag.TextBounds.Y);
1913 else
1914 DistanceTag.Visible = false;
1915 end
1916 else
1917 NameTag.Visible = false;
1918 DistanceTag.Visible = false;
1919 end
1920 else
1921 NameTag.Visible = false;
1922 DistanceTag.Visible = false;
1923 Tracer.Visible = false;
1924 end
1925
1926 Data.Instances['NameTag'] = NameTag;
1927 Data.Instances['DistanceTag'] = DistanceTag;
1928 Data.Instances['Tracer'] = Tracer;
1929
1930 shared.InstanceData[v.Instance:GetDebugId()] = Data;
1931 end
1932 end
1933 for i, v in pairs(Players:GetPlayers()) do
1934 local Data = shared.InstanceData[v.Name] or { Instances = {}; };
1935
1936 Data.Instances['Box'] = Data.Instances['Box'] or LineBox:Create{Thickness = 3};
1937 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
1938 Transparency = 1;
1939 Thickness = 2;
1940 }
1941 Data.Instances['HeadDot'] = Data.Instances['HeadDot'] or NewDrawing'Circle'{
1942 Filled = true;
1943 NumSides = 30;
1944 }
1945 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
1946 Size = Options.TextSize.Value;
1947 Center = true;
1948 Outline = Options.TextOutline.Value;
1949 Visible = true;
1950 };
1951 Data.Instances['DistanceHealthTag'] = Data.Instances['DistanceHealthTag'] or NewDrawing'Text'{
1952 Size = Options.TextSize.Value - 1;
1953 Center = true;
1954 Outline = Options.TextOutline.Value;
1955 Visible = true;
1956 };
1957
1958 local NameTag = Data.Instances['NameTag'];
1959 local DistanceTag = Data.Instances['DistanceHealthTag'];
1960 local Tracer = Data.Instances['Tracer'];
1961 local HeadDot = Data.Instances['HeadDot'];
1962 local Box = Data.Instances['Box'];
1963
1964 local Character = GetCharacter(v);
1965 local Pass, Distance = CheckPlayer(v, Character);
1966
1967 if Pass and Character then
1968 local Humanoid = Character:FindFirstChildOfClass'Humanoid';
1969 local Head = Character:FindFirstChild'Head';
1970 local HumanoidRootPart = Character:FindFirstChild'HumanoidRootPart';
1971 local Dead = Humanoid and Humanoid:GetState().Name == 'Dead';
1972
1973 if Character ~= nil and Head and HumanoidRootPart and not Dead then
1974 local ScreenPosition, Vis = WorldToViewport(Head.Position);
1975 local Color = Rainbow and Color3.fromHSV(tick() * 128 % 255/255, 1, 1) or (CheckTeam(v) and TeamColor or EnemyColor); Color = Options.ShowTeamColor.Value and v.TeamColor.Color or Color;
1976 local OPos = Camera.CFrame:pointToObjectSpace(Head.Position);
1977
1978 if ScreenPosition.Z < 0 then
1979 local AT = math.atan2(OPos.Y, OPos.X) + math.pi;
1980 OPos = CFrame.Angles(0, 0, AT):vectorToWorldSpace((CFrame.Angles(0, math.rad(89.9), 0):vectorToWorldSpace(V3New(0, 0, -1))));
1981 end
1982
1983 local Position = WorldToViewport(Camera.CFrame:pointToWorldSpace(OPos));
1984
1985 if Options.ShowTracers.Value then
1986 if TracerPosition.X >= Camera.ViewportSize.X or TracerPosition.Y >= Camera.ViewportSize.Y or TracerPosition.X < 0 or TracerPosition.Y < 0 then
1987 TracerPosition = V2New(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y - 135);
1988 end
1989
1990 Tracer.Visible = true;
1991 Tracer.Transparency = math.clamp(1 - (Distance / 200), 0.25, 0.75);
1992 Tracer.From = TracerPosition;
1993 Tracer.To = V2New(Position.X, Position.Y);
1994 Tracer.Color = Color;
1995 else
1996 Tracer.Visible = false;
1997 end
1998
1999 if ScreenPosition.Z > 0 then
2000 local ScreenPositionUpper = WorldToViewport((HumanoidRootPart:GetRenderCFrame() * CFrame.new(0, Head.Size.Y + HumanoidRootPart.Size.Y + (Options.YOffset.Value / 25), 0)).Position);
2001 local Scale = Head.Size.Y / 2;
2002
2003 if Options.ShowName.Value then
2004 NameTag.Visible = true;
2005 NameTag.Text = v.Name .. (CustomPlayerTag and CustomPlayerTag(v) or '');
2006 NameTag.Size = Options.TextSize.Value;
2007 NameTag.Outline = Options.TextOutline.Value;
2008 NameTag.Position = V2New(ScreenPositionUpper.X, ScreenPositionUpper.Y) - V2New(0, NameTag.TextBounds.Y);
2009 NameTag.Color = Color;
2010 NameTag.Transparency= 0.85;
2011 if Drawing.Fonts and shared.am_ic3 then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
2012 NameTag.Font = Drawing.Fonts.Monospace;
2013 end
2014 else
2015 NameTag.Visible = false;
2016 end
2017 if Options.ShowDistance.Value or Options.ShowHealth.Value then
2018 DistanceTag.Visible = true;
2019 DistanceTag.Size = Options.TextSize.Value - 1;
2020 DistanceTag.Outline = Options.TextOutline.Value;
2021 DistanceTag.Color = Color3.new(1, 1, 1);
2022 DistanceTag.Transparency= 0.85;
2023 if Drawing.Fonts and shared.am_ic3 then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
2024 NameTag.Font = Drawing.Fonts.Monospace;
2025 end
2026
2027 local Str = '';
2028
2029 if Options.ShowDistance.Value then
2030 Str = Str .. Format('[%d] ', Distance);
2031 end
2032 if Options.ShowHealth.Value and Humanoid then
2033 Str = Str .. Format('[%d/%d] [%s%%]', Humanoid.Health, Humanoid.MaxHealth, math.floor(Humanoid.Health / Humanoid.MaxHealth * 100));
2034 end
2035
2036 DistanceTag.Text = Str;
2037 DistanceTag.Position = (NameTag.Visible and NameTag.Position + V2New(0, NameTag.TextBounds.Y) or V2New(ScreenPositionUpper.X, ScreenPositionUpper.Y));
2038 else
2039 DistanceTag.Visible = false;
2040 end
2041 if Options.ShowDot.Value and Vis then
2042 local Top = WorldToViewport((Head.CFrame * CFrame.new(0, Scale, 0)).Position);
2043 local Bottom = WorldToViewport((Head.CFrame * CFrame.new(0, -Scale, 0)).Position);
2044 local Radius = (Top - Bottom).y;
2045
2046 HeadDot.Visible = true;
2047 HeadDot.Color = Color;
2048 HeadDot.Position = V2New(ScreenPosition.X, ScreenPosition.Y);
2049 HeadDot.Radius = Radius;
2050 else
2051 HeadDot.Visible = false;
2052 end
2053 if Options.ShowBoxes.Value and Vis and HumanoidRootPart then
2054 Box:Update(HumanoidRootPart.CFrame, V3New(2, 3, 0) * (Scale * 2), Color);
2055 else
2056 Box:SetVisible(false);
2057 end
2058 else
2059 NameTag.Visible = false;
2060 DistanceTag.Visible = false;
2061 HeadDot.Visible = false;
2062
2063 Box:SetVisible(false);
2064 end
2065 else
2066 NameTag.Visible = false;
2067 DistanceTag.Visible = false;
2068 HeadDot.Visible = false;
2069 Tracer.Visible = false;
2070
2071 Box:SetVisible(false);
2072 end
2073 else
2074 NameTag.Visible = false;
2075 DistanceTag.Visible = false;
2076 HeadDot.Visible = false;
2077 Tracer.Visible = false;
2078
2079 Box:SetVisible(false);
2080 end
2081
2082 shared.InstanceData[v.Name] = Data;
2083 end
2084 end
2085end
2086
2087local LastInvalidCheck = 0;
2088
2089function Update()
2090 if tick() - LastInvalidCheck > 0.3 then
2091 LastInvalidCheck = tick();
2092
2093 if Camera.Parent ~= workspace then
2094 Camera = workspace.CurrentCamera;
2095 WTVP = Camera.WorldToViewportPoint;
2096 end
2097
2098 for i, v in pairs(shared.InstanceData) do
2099 if not Players:FindFirstChild(tostring(i)) then
2100 if not shared.InstanceData[i].DontDelete then
2101 GetTableData(v.Instances)(function(i, obj)
2102 obj.Visible = false;
2103 obj:Remove();
2104 v.Instances[i] = nil;
2105 end)
2106 shared.InstanceData[i] = nil;
2107 else
2108 if shared.InstanceData[i].Instance == nil or shared.InstanceData[i].Instance.Parent == nil then
2109 GetTableData(v.Instances)(function(i, obj)
2110 obj.Visible = false;
2111 obj:Remove();
2112 v.Instances[i] = nil;
2113 end)
2114 shared.InstanceData[i] = nil;
2115 end
2116 end
2117 end
2118 end
2119 end
2120
2121 local CX = Menu:GetInstance'CrosshairX';
2122 local CY = Menu:GetInstance'CrosshairY';
2123
2124 if Options.Crosshair.Value then
2125 CX.Visible = true;
2126 CY.Visible = true;
2127
2128 CX.To = V2New((Camera.ViewportSize.X / 2) - 8, (Camera.ViewportSize.Y / 2));
2129 CX.From = V2New((Camera.ViewportSize.X / 2) + 8, (Camera.ViewportSize.Y / 2));
2130 CY.To = V2New((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) - 8);
2131 CY.From = V2New((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) + 8);
2132 else
2133 CX.Visible = false;
2134 CY.Visible = false;
2135 end
2136
2137 if Options.MenuOpen.Value and MenuLoaded then
2138 local MLocation = GetMouseLocation();
2139 shared.MenuDrawingData.Instances.Main.Color = Color3.fromHSV(tick() * 24 % 255/255, 1, 1);
2140 local MainInstance = Menu:GetInstance'Main';
2141
2142 local Values = {
2143 MainInstance.Position.X;
2144 MainInstance.Position.Y;
2145 MainInstance.Position.X + MainInstance.Size.X;
2146 MainInstance.Position.Y + MainInstance.Size.Y;
2147 };
2148
2149 if MainInstance and (MouseHoveringOver(Values) or (SubMenu.Open and MouseHoveringOver(SubMenu.Bounds))) then
2150 Debounce.CursorVis = true;
2151
2152 Menu:UpdateMenuInstance'Cursor1'{
2153 Visible = true;
2154 From = V2New(MLocation.x, MLocation.y);
2155 To = V2New(MLocation.x + 5, MLocation.y + 6);
2156 }
2157 Menu:UpdateMenuInstance'Cursor2'{
2158 Visible = true;
2159 From = V2New(MLocation.x, MLocation.y);
2160 To = V2New(MLocation.x, MLocation.y + 8);
2161 }
2162 Menu:UpdateMenuInstance'Cursor3'{
2163 Visible = true;
2164 From = V2New(MLocation.x, MLocation.y + 6);
2165 To = V2New(MLocation.x + 5, MLocation.y + 5);
2166 }
2167 else
2168 if Debounce.CursorVis then
2169 Debounce.CursorVis = false;
2170
2171 Menu:UpdateMenuInstance'Cursor1'{Visible = false};
2172 Menu:UpdateMenuInstance'Cursor2'{Visible = false};
2173 Menu:UpdateMenuInstance'Cursor3'{Visible = false};
2174 end
2175 end
2176 if MouseHeld then
2177 local MousePos = GetMouseLocation();
2178
2179 if Dragging then
2180 DraggingWhat.Slider.Position = V2New(math.clamp(MLocation.X - DraggingWhat.Slider.Size.X / 2, DraggingWhat.Line.Position.X, DraggingWhat.Line.Position.X + DraggingWhat.Line.Size.X - DraggingWhat.Slider.Size.X), DraggingWhat.Slider.Position.Y);
2181 local Percent = (DraggingWhat.Slider.Position.X - DraggingWhat.Line.Position.X) / ((DraggingWhat.Line.Position.X + DraggingWhat.Line.Size.X - DraggingWhat.Line.Position.X) - DraggingWhat.Slider.Size.X);
2182 local Value = CalculateValue(DraggingWhat.Min, DraggingWhat.Max, Percent);
2183 DraggingWhat.Option(Value);
2184 elseif DraggingUI then
2185 Debounce.UIDrag = true;
2186 local Main = Menu:GetInstance'Main';
2187 Main.Position = MousePos + DragOffset;
2188 elseif DragTracerPosition then
2189 TracerPosition = MousePos;
2190 end
2191 else
2192 Dragging = false;
2193 DragTracerPosition = false;
2194 if DraggingUI and Debounce.UIDrag then
2195 Debounce.UIDrag = false;
2196 DraggingUI = false;
2197 CreateMenu(Menu:GetInstance'Main'.Position);
2198 end
2199 end
2200 if not Debounce.Menu then
2201 Debounce.Menu = true;
2202 ToggleMenu();
2203 end
2204 elseif Debounce.Menu and not Options.MenuOpen.Value then
2205 Debounce.Menu = false;
2206 ToggleMenu();
2207 end
2208end
2209
2210RunService:UnbindFromRenderStep(GetDataName);
2211RunService:UnbindFromRenderStep(UpdateName);
2212
2213RunService:BindToRenderStep(GetDataName, 300, UpdatePlayerData);
2214RunService:BindToRenderStep(UpdateName, 199, Update);