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