Advertisement
Guest User

esp

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