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