NikHacks

Un Named Esp

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