Advertisement
Just_A_Name

my private stuff

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