EclipseYoutube

Untitled

Nov 24th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.57 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.  
  31. shared.MenuDrawingData = shared.MenuDrawingData or { Instances = {} };
  32. shared.PlayerData = shared.PlayerData or {};
  33. shared.RSName = shared.RSName or ('YeetESP_by_urmum' .. HttpService:GenerateGUID(false));
  34.  
  35. local GetDataName = shared.RSName .. '-GetData';
  36. local UpdateName = shared.RSName .. '-Update';
  37.  
  38. local Debounce = setmetatable({}, {
  39. __index = function(t, i)
  40. return rawget(t, i) or false
  41. end;
  42. });
  43.  
  44. pcall(function() shared.InputBeganCon:disconnect() end);
  45. pcall(function() shared.InputEndedCon:disconnect() end);
  46.  
  47. local Teams = {};
  48. local CustomTeams = { -- Games that don't use roblox's team system
  49. [2563455047] = {
  50. Initialize = function()
  51. Teams.Sheriffs = {}; -- prevent big error
  52. Teams.Bandits = {}; -- prevent big error
  53. local Func = game:GetService'ReplicatedStorage':WaitForChild('RogueFunc', 1);
  54. local Event = game:GetService'ReplicatedStorage':WaitForChild('RogueEvent', 1);
  55. local S, B = Func:InvokeServer'AllTeamData';
  56.  
  57. Teams.Sheriffs = S;
  58. Teams.Bandits = B;
  59.  
  60. Event.OnClientEvent:connect(function(id, PlayerName, Team, Remove) -- stolen straight from decompiled src lul
  61. if id == 'UpdateTeam' then
  62. local TeamTable, NotTeamTable
  63. if Team == 'Bandits' then
  64. TeamTable = TDM.Bandits
  65. NotTeamTable = TDM.Sheriffs
  66. else
  67. TeamTable = TDM.Sheriffs
  68. NotTeamTable = TDM.Bandits
  69. end
  70. if Remove then
  71. TeamTable[PlayerName] = nil
  72. else
  73. TeamTable[PlayerName] = true
  74. NotTeamTable[PlayerName] = nil
  75. end
  76. if PlayerName == LocalPlayer.Name then
  77. TDM.Friendlys = TeamTable
  78. TDM.Enemies = NotTeamTable
  79. end
  80. end
  81. end)
  82. end;
  83. CheckTeam = function(Player)
  84. local LocalTeam = Teams.Sheriffs[LocalPlayer.Name] and Teams.Sheriffs or Teams.Bandits;
  85.  
  86. return LocalTeam[Player.Name] and true or false;
  87. end;
  88. };
  89. }
  90.  
  91. function GetMouseLocation()
  92. return UserInputService:GetMouseLocation();
  93. end
  94.  
  95. function MouseHoveringOver(Values)
  96. local X1, Y1, X2, Y2 = Values[1], Values[2], Values[3], Values[4]
  97. local MLocation = GetMouseLocation();
  98. return (MLocation.x >= X1 and MLocation.x <= (X1 + (X2 - X1))) and (MLocation.y >= Y1 and MLocation.y <= (Y1 + (Y2 - Y1)));
  99. end
  100.  
  101. function GetTableData(t) -- basically table.foreach i dont even know why i made this
  102. if typeof(t) ~= 'table' then return end
  103. return setmetatable(t, {
  104. __call = function(t, func)
  105. if typeof(func) ~= 'function' then return end;
  106. for i, v in pairs(t) do
  107. pcall(func, i, v);
  108. end
  109. end;
  110. });
  111. end
  112. local function Format(format, ...)
  113. return string.format(format, ...);
  114. end
  115. function CalculateValue(Min, Max, Percent)
  116. return Min + math.floor(((Max - Min) * Percent) + .5);
  117. end
  118.  
  119. local Options = setmetatable({}, {
  120. __call = function(t, ...)
  121. local Arguments = {...};
  122. local Name = Arguments[1];
  123. OIndex = OIndex + 1; -- (typeof(Arguments[3]) == 'boolean' and 1 or 0);
  124. rawset(t, Name, setmetatable({
  125. Name = Arguments[1];
  126. Text = Arguments[2];
  127. Value = Arguments[3];
  128. DefaultValue = Arguments[3];
  129. AllArgs = Arguments;
  130. Index = OIndex;
  131. }, {
  132. __call = function(t, v)
  133. if typeof(t.Value) == 'function' then
  134. t.Value();
  135. elseif typeof(t.Value) == 'EnumItem' then
  136. local BT = Menu:GetInstance(Format('%s_BindText', t.Name));
  137. Binding = true;
  138. local Val = 0
  139. while Binding do
  140. wait();
  141. Val = (Val + 1) % 17;
  142. BT.Text = Val <= 8 and '|' or '';
  143. end
  144. t.Value = BindedKey;
  145. BT.Text = tostring(t.Value):match'%w+%.%w+%.(.+)';
  146. BT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - BT.TextBounds.X - 20, -10);
  147. else
  148. local NewValue = v;
  149. if NewValue == nil then NewValue = not t.Value; end
  150. rawset(t, 'Value', NewValue);
  151. if Arguments[2] ~= nil then
  152. if typeof(Arguments[3]) == 'number' then
  153. local AMT = Menu:GetInstance(Format('%s_AmountText', t.Name));
  154. AMT.Text = tostring(t.Value);
  155. AMT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - AMT.TextBounds.X - 10, -10);
  156. else
  157. local Inner = Menu:GetInstance(Format('%s_InnerCircle', t.Name));
  158. Inner.Visible = t.Value;
  159. end
  160. end
  161. end
  162. end;
  163. }));
  164. end;
  165. })
  166.  
  167. function Load()
  168. local _, Result = pcall(readfile, OptionsFile);
  169. if _ then -- extremely ugly code yea i know but i dont care p.s. i hate pcall
  170. local _, Table = pcall(HttpService.JSONDecode, HttpService, Result);
  171. if _ then
  172. for i, v in pairs(Table) do
  173. if Options[i] ~= nil and Options[i].Value ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
  174. Options[i].Value = v.Value;
  175. pcall(Options[i], v.Value);
  176. end
  177. end
  178. end
  179. end
  180. end
  181.  
  182. Options('Enabled', 'ESP Enabled', true);
  183. Options('ShowTeam', 'Show Team', false);
  184. Options('ShowName', 'Show Names', true);
  185. Options('ShowDistance', 'Show Distance', true);
  186. Options('ShowHealth', 'Show Health', true);
  187. Options('ShowBoxes', 'Show Boxes', true);
  188. Options('ShowTracers', 'Show Tracers', true);
  189. Options('ShowDot', 'Show Head Dot', false);
  190. Options('VisCheck', 'Visibility Check', false);
  191. Options('Crosshair', 'Crosshair', false);
  192. Options('TextOutline', 'Text Outline', true);
  193. Options('TextSize', 'Text Size', syn and 18 or 14, 10, 24); -- cuz synapse fonts look weird???
  194. Options('MaxDistance', 'Max Distance', 2500, 100, 5000);
  195. Options('RefreshRate', 'Refresh Rate (ms)', 5, 1, 200);
  196. Options('MenuKey', 'Menu Key', Enum.KeyCode.F4, 1);
  197. Options('ResetSettings', 'Reset Settings', function()
  198. for i, v in pairs(Options) do
  199. 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
  200. Options[i](Options[i].DefaultValue);
  201. end
  202. end
  203. end, 4);
  204. Options('LoadSettings', 'Load Settings', Load, 3);
  205. Options('SaveSettings', 'Save Settings', function()
  206. writefile(OptionsFile, HttpService:JSONEncode(Options));
  207. end, 2)
  208. -- Options.SaveSettings.Value();
  209.  
  210. Load();
  211.  
  212. Options('MenuOpen', nil, true);
  213.  
  214. local function Set(t, i, v)
  215. t[i] = v;
  216. end
  217. local function Combine(...)
  218. local Output = {};
  219. for i, v in pairs{...} do
  220. if typeof(v) == 'table' then
  221. table.foreach(v, function(i, v)
  222. Output[i] = v;
  223. end)
  224. end
  225. end
  226. return Output
  227. end
  228. function IsStringEmpty(String)
  229. if type(String) == 'string' then
  230. return String:match'^%s+$' ~= nil or #String == 0 or String == '' or false;
  231. end
  232. return false
  233. end
  234.  
  235. function NewDrawing(InstanceName)
  236. local Instance = Drawing.new(InstanceName);
  237. return (function(Properties)
  238. for i, v in pairs(Properties) do
  239. pcall(Set, Instance, i, v);
  240. end
  241. return Instance;
  242. end)
  243. end
  244.  
  245. function Menu:AddMenuInstace(Name, Instance)
  246. if shared.MenuDrawingData.Instances[Name] ~= nil then
  247. shared.MenuDrawingData.Instances[Name]:Remove();
  248. end
  249. shared.MenuDrawingData.Instances[Name] = Instance;
  250. return Instance;
  251. end
  252. function Menu:UpdateMenuInstance(Name)
  253. local Instance = shared.MenuDrawingData.Instances[Name];
  254. if Instance ~= nil then
  255. return (function(Properties)
  256. for i, v in pairs(Properties) do
  257. -- print(Format('%s %s -> %s', Name, tostring(i), tostring(v)));
  258. pcall(Set, Instance, i, v);
  259. end
  260. return Instance;
  261. end)
  262. end
  263. end
  264. function Menu:GetInstance(Name)
  265. return shared.MenuDrawingData.Instances[Name];
  266. end
  267.  
  268. function LineBox:Create(Properties)
  269. local Box = { Visible = true }; -- prevent errors not really though dont worry bout the Visible = true thing
  270.  
  271. local Properties = Combine({
  272. Transparency = 1;
  273. Thickness = 1;
  274. Visible = true;
  275. }, Properties);
  276.  
  277. Box['TopLeft'] = NewDrawing'Line'(Properties);
  278. Box['TopRight'] = NewDrawing'Line'(Properties);
  279. Box['BottomLeft'] = NewDrawing'Line'(Properties);
  280. Box['BottomRight'] = NewDrawing'Line'(Properties);
  281.  
  282. function Box:Update(CF, Size, Color, Properties)
  283. if not CF or not Size then return end
  284.  
  285. local TLPos, Visible1 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, Size.Y, 0)).p);
  286. local TRPos, Visible2 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, Size.Y, 0)).p);
  287. local BLPos, Visible3 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, -Size.Y, 0)).p);
  288. local BRPos, Visible4 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, -Size.Y, 0)).p);
  289. -- ## BEGIN UGLY CODE
  290. if Visible1 then
  291. Box['TopLeft'].Visible = true;
  292. Box['TopLeft'].Color = Color;
  293. Box['TopLeft'].From = Vector2.new(TLPos.X, TLPos.Y);
  294. Box['TopLeft'].To = Vector2.new(TRPos.X, TRPos.Y);
  295. else
  296. Box['TopLeft'].Visible = false;
  297. end
  298. if Visible2 then
  299. Box['TopRight'].Visible = true;
  300. Box['TopRight'].Color = Color;
  301. Box['TopRight'].From = Vector2.new(TRPos.X, TRPos.Y);
  302. Box['TopRight'].To = Vector2.new(BRPos.X, BRPos.Y);
  303. else
  304. Box['TopRight'].Visible = false;
  305. end
  306. if Visible3 then
  307. Box['BottomLeft'].Visible = true;
  308. Box['BottomLeft'].Color = Color;
  309. Box['BottomLeft'].From = Vector2.new(BLPos.X, BLPos.Y);
  310. Box['BottomLeft'].To = Vector2.new(TLPos.X, TLPos.Y);
  311. else
  312. Box['BottomLeft'].Visible = false;
  313. end
  314. if Visible4 then
  315. Box['BottomRight'].Visible = true;
  316. Box['BottomRight'].Color = Color;
  317. Box['BottomRight'].From = Vector2.new(BRPos.X, BRPos.Y);
  318. Box['BottomRight'].To = Vector2.new(BLPos.X, BLPos.Y);
  319. else
  320. Box['BottomRight'].Visible = false;
  321. end
  322. -- ## END UGLY CODE
  323. if Properties then
  324. GetTableData(Properties)(function(i, v)
  325. pcall(Set, Box['TopLeft'], i, v);
  326. pcall(Set, Box['TopRight'], i, v);
  327. pcall(Set, Box['BottomLeft'], i, v);
  328. pcall(Set, Box['BottomRight'], i, v);
  329. end)
  330. end
  331. end
  332. function Box:SetVisible(bool)
  333. pcall(Set, Box['TopLeft'], 'Visible', bool);
  334. pcall(Set, Box['TopRight'], 'Visible', bool);
  335. pcall(Set, Box['BottomLeft'], 'Visible', bool);
  336. pcall(Set, Box['BottomRight'], 'Visible', bool);
  337. end
  338. function Box:Remove()
  339. self:SetVisible(false);
  340. Box['TopLeft']:Remove();
  341. Box['TopRight']:Remove();
  342. Box['BottomLeft']:Remove();
  343. Box['BottomRight']:Remove();
  344. end
  345.  
  346. return Box;
  347. end
  348.  
  349. function CreateMenu(NewPosition) -- Create Menu
  350. local function FromHex(HEX)
  351. HEX = HEX:gsub('#', '');
  352. return Color3.fromRGB(tonumber('0x' .. HEX:sub(1, 2)), tonumber('0x' .. HEX:sub(3, 4)), tonumber('0x' .. HEX:sub(5, 6)));
  353. end
  354.  
  355. local Colors = {
  356. Primary = {
  357. Main = FromHex'424242';
  358. Light = FromHex'6d6d6d';
  359. Dark = FromHex'1b1b1b';
  360. };
  361. Secondary = {
  362. Main = FromHex'e0e0e0';
  363. Light = FromHex'ffffff';
  364. Dark = FromHex'aeaeae';
  365. };
  366. };
  367.  
  368. MenuLoaded = false;
  369.  
  370. GetTableData(UIButtons)(function(i, v)
  371. v.Instance.Visible = false;
  372. v.Instance:Remove();
  373. end)
  374. GetTableData(Sliders)(function(i, v)
  375. v.Instance.Visible = false;
  376. v.Instance:Remove();
  377. end)
  378.  
  379. UIButtons = {};
  380. Sliders = {};
  381.  
  382. local BaseSize = Vector2.new(300, 580);
  383. local BasePosition = NewPosition or Vector2.new(Camera.ViewportSize.X / 8 - (BaseSize.X / 2), Camera.ViewportSize.Y / 2 - (BaseSize.Y / 2));
  384.  
  385. Menu:AddMenuInstace('CrosshairX', NewDrawing'Line'{
  386. Visible = false;
  387. Color = Color3.new(0, 1, 0);
  388. Transparency = 1;
  389. Thickness = 1;
  390. });
  391. Menu:AddMenuInstace('CrosshairY', NewDrawing'Line'{
  392. Visible = false;
  393. Color = Color3.new(0, 1, 0);
  394. Transparency = 1;
  395. Thickness = 1;
  396. });
  397.  
  398. delay(.025, function() -- since zindex doesnt exist
  399. Menu:AddMenuInstace('Main', NewDrawing'Square'{
  400. Size = BaseSize;
  401. Position = BasePosition;
  402. Filled = false;
  403. Color = Colors.Primary.Main;
  404. Thickness = 3;
  405. Visible = true;
  406. });
  407. end);
  408. Menu:AddMenuInstace('TopBar', NewDrawing'Square'{
  409. Position = BasePosition;
  410. Size = Vector2.new(BaseSize.X, 25);
  411. Color = Colors.Primary.Dark;
  412. Filled = true;
  413. Visible = true;
  414. });
  415. Menu:AddMenuInstace('TopBarTwo', NewDrawing'Square'{
  416. Position = BasePosition + Vector2.new(0, 25);
  417. Size = Vector2.new(BaseSize.X, 60);
  418. Color = Colors.Primary.Main;
  419. Filled = true;
  420. Visible = true;
  421. });
  422. Menu:AddMenuInstace('TopBarText', NewDrawing'Text'{
  423. Size = 25;
  424. Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(25, 15);
  425. Text = 'YEET ESP';
  426. Color = Colors.Secondary.Light;
  427. Visible = true;
  428. });
  429. Menu:AddMenuInstace('TopBarTextBR', NewDrawing'Text'{
  430. Size = 15;
  431. Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(BaseSize.X - 65, 40);
  432. Text = 'by Synergy.';
  433. Color = Colors.Secondary.Dark;
  434. Visible = true;
  435. });
  436. Menu:AddMenuInstace('Filling', NewDrawing'Square'{
  437. Size = BaseSize - Vector2.new(0, 85);
  438. Position = BasePosition + Vector2.new(0, 85);
  439. Filled = true;
  440. Color = Colors.Secondary.Main;
  441. Transparency= .5;
  442. Visible = true;
  443. });
  444.  
  445. local CPos = 0;
  446.  
  447. GetTableData(Options)(function(i, v)
  448. if typeof(v.Value) == 'boolean' and not IsStringEmpty(v.Text) and v.Text ~= nil then
  449. CPos = CPos + 25;
  450. local BaseSize = Vector2.new(BaseSize.X, 30);
  451. local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(30, v.Index * 25 - 10);
  452. UIButtons[#UIButtons + 1] = {
  453. Option = v;
  454. Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
  455. Position = BasePosition - Vector2.new(30, 15);
  456. Size = BaseSize;
  457. Visible = false;
  458. });
  459. };
  460. Menu:AddMenuInstace(Format('%s_OuterCircle', v.Name), NewDrawing'Circle'{
  461. Radius = 10;
  462. Position = BasePosition;
  463. Color = Colors.Secondary.Light;
  464. Filled = true;
  465. Visible = true;
  466. });
  467. Menu:AddMenuInstace(Format('%s_InnerCircle', v.Name), NewDrawing'Circle'{
  468. Radius = 7;
  469. Position = BasePosition;
  470. Color = Colors.Secondary.Dark;
  471. Filled = true;
  472. Visible = v.Value;
  473. });
  474. Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
  475. Text = v.Text;
  476. Size = 20;
  477. Position = BasePosition + Vector2.new(20, -10);
  478. Visible = true;
  479. Color = Colors.Primary.Dark;
  480. });
  481. end
  482. end)
  483. GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
  484. if typeof(v.Value) == 'number' then
  485. CPos = CPos + 25;
  486.  
  487. local BaseSize = Vector2.new(BaseSize.X, 30);
  488. local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
  489.  
  490. local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
  491. Text = v.Text;
  492. Size = 20;
  493. Position = BasePosition + Vector2.new(20, -10);
  494. Visible = true;
  495. Color = Colors.Primary.Dark;
  496. });
  497. local AMT = Menu:AddMenuInstace(Format('%s_AmountText', v.Name), NewDrawing'Text'{
  498. Text = tostring(v.Value);
  499. Size = 20;
  500. Position = BasePosition;
  501. Visible = true;
  502. Color = Colors.Primary.Dark;
  503. });
  504. local Line = Menu:AddMenuInstace(Format('%s_SliderLine', v.Name), NewDrawing'Line'{
  505. Transparency = 1;
  506. Color = Colors.Primary.Dark;
  507. Thickness = 3;
  508. Visible = true;
  509. From = BasePosition + Vector2.new(20, 20);
  510. To = BasePosition + Vector2.new(BaseSize.X - 10, 20);
  511. });
  512. CPos = CPos + 10;
  513. local Slider = Menu:AddMenuInstace(Format('%s_Slider', v.Name), NewDrawing'Circle'{
  514. Visible = true;
  515. Filled = true;
  516. Radius = 6;
  517. Color = Colors.Secondary.Dark;
  518. Position = BasePosition + Vector2.new(35, 20);
  519. })
  520.  
  521. local CSlider = {Slider = Slider; Line = Line; Min = v.AllArgs[4]; Max = v.AllArgs[5]; Option = v};
  522. Sliders[#Sliders + 1] = CSlider;
  523.  
  524. -- local Percent = (v.Value / CSlider.Max) * 100;
  525. -- local Size = math.abs(Line.From.X - Line.To.X);
  526. -- local Value = Size * (Percent / 100); -- this shit's inaccurate but fuck it i'm not even gonna bother fixing it
  527.  
  528. Slider.Position = BasePosition + Vector2.new(40, 20);
  529.  
  530. v.BaseSize = BaseSize;
  531. v.BasePosition = BasePosition;
  532. AMT.Position = BasePosition + Vector2.new(BaseSize.X - AMT.TextBounds.X - 10, -10)
  533. end
  534. end)
  535. GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
  536. if typeof(v.Value) == 'EnumItem' then
  537. CPos = CPos + 30;
  538.  
  539. local BaseSize = Vector2.new(BaseSize.X, 30);
  540. local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
  541.  
  542. UIButtons[#UIButtons + 1] = {
  543. Option = v;
  544. Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
  545. Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
  546. Visible = true;
  547. Transparency= .5;
  548. Position = BasePosition + Vector2.new(15, -10);
  549. Color = Colors.Secondary.Light;
  550. Filled = true;
  551. });
  552. };
  553. local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
  554. Text = v.Text;
  555. Size = 20;
  556. Position = BasePosition + Vector2.new(20, -10);
  557. Visible = true;
  558. Color = Colors.Primary.Dark;
  559. });
  560. local BindText = Menu:AddMenuInstace(Format('%s_BindText', v.Name), NewDrawing'Text'{
  561. Text = tostring(v.Value):match'%w+%.%w+%.(.+)';
  562. Size = 20;
  563. Position = BasePosition;
  564. Visible = true;
  565. Color = Colors.Primary.Dark;
  566. });
  567.  
  568. Options[i].BaseSize = BaseSize;
  569. Options[i].BasePosition = BasePosition;
  570. BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 20, -10);
  571. end
  572. end)
  573. GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
  574. if typeof(v.Value) == 'function' then
  575. local BaseSize = Vector2.new(BaseSize.X, 30);
  576. local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos + (25 * v.AllArgs[4]) - 35);
  577.  
  578. UIButtons[#UIButtons + 1] = {
  579. Option = v;
  580. Instance = Menu:AddMenuInstace(Format('%s_Hitbox', v.Name), NewDrawing'Square'{
  581. Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
  582. Visible = true;
  583. Transparency= .5;
  584. Position = BasePosition + Vector2.new(15, -10);
  585. Color = Colors.Secondary.Light;
  586. Filled = true;
  587. });
  588. };
  589. local Text = Menu:AddMenuInstace(Format('%s_Text', v.Name), NewDrawing'Text'{
  590. Text = v.Text;
  591. Size = 20;
  592. Position = BasePosition + Vector2.new(20, -10);
  593. Visible = true;
  594. Color = Colors.Primary.Dark;
  595. });
  596.  
  597. -- BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 10, -10);
  598. end
  599. end)
  600.  
  601. delay(.1, function()
  602. MenuLoaded = true;
  603. end);
  604.  
  605. -- this has to be at the bottom cuz proto drawing api doesnt have zindex :triumph:
  606. Menu:AddMenuInstace('Cursor1', NewDrawing'Line'{
  607. Visible = false;
  608. Color = Color3.new(1, 0, 0);
  609. Transparency = 1;
  610. Thickness = 2;
  611. });
  612. Menu:AddMenuInstace('Cursor2', NewDrawing'Line'{
  613. Visible = false;
  614. Color = Color3.new(1, 0, 0);
  615. Transparency = 1;
  616. Thickness = 2;
  617. });
  618. Menu:AddMenuInstace('Cursor3', NewDrawing'Line'{
  619. Visible = false;
  620. Color = Color3.new(1, 0, 0);
  621. Transparency = 1;
  622. Thickness = 2;
  623. });
  624. end
  625.  
  626. CreateMenu();
  627.  
  628. shared.InputBeganCon = UserInputService.InputBegan:connect(function(input)
  629. if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
  630. MouseHeld = true;
  631. local Bar = Menu:GetInstance'TopBar';
  632. local Values = {
  633. Bar.Position.X;
  634. Bar.Position.Y;
  635. Bar.Position.X + Bar.Size.X;
  636. Bar.Position.Y + Bar.Size.Y;
  637. }
  638. if MouseHoveringOver(Values) and not syn then -- disable dragging for synapse cuz idk why it breaks
  639. DraggingUI = true;
  640. DragOffset = Menu:GetInstance'Main'.Position - GetMouseLocation();
  641. else
  642. for i, v in pairs(Sliders) do
  643. local Values = {
  644. v.Line.From.X - (v.Slider.Radius);
  645. v.Line.From.Y - (v.Slider.Radius);
  646. v.Line.To.X + (v.Slider.Radius);
  647. v.Line.To.Y + (v.Slider.Radius);
  648. };
  649. if MouseHoveringOver(Values) then
  650. DraggingWhat = v;
  651. Dragging = true;
  652. break
  653. end
  654. end
  655. end
  656. end
  657. end)
  658. shared.InputEndedCon = UserInputService.InputEnded:connect(function(input)
  659. if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
  660. MouseHeld = false;
  661. for i, v in pairs(UIButtons) do
  662. local Values = {
  663. v.Instance.Position.X;
  664. v.Instance.Position.Y;
  665. v.Instance.Position.X + v.Instance.Size.X;
  666. v.Instance.Position.Y + v.Instance.Size.Y;
  667. };
  668. if MouseHoveringOver(Values) then
  669. v.Option();
  670. break -- prevent clicking 2 options
  671. end
  672. end
  673. elseif input.UserInputType.Name == 'Keyboard' then
  674. if Binding then
  675. BindedKey = input.KeyCode;
  676. Binding = false;
  677. elseif input.KeyCode == Options.MenuKey.Value or (input.KeyCode == Enum.KeyCode.Home and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl)) then
  678. Options.MenuOpen();
  679. end
  680. end
  681. end)
  682.  
  683. function ToggleMenu()
  684. if Options.MenuOpen.Value then
  685. GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
  686. if OldData[v] then
  687. pcall(Set, v, 'Visible', true);
  688. end
  689. end)
  690. else
  691. -- GUIService:SetMenuIsOpen(false);
  692. GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
  693. if v.Visible == true then
  694. OldData[v] = true;
  695. pcall(Set, v, 'Visible', false);
  696. end
  697. end)
  698. end
  699. end
  700.  
  701. function CheckRay(Player, Distance, Position, Unit)
  702. local Pass = true;
  703.  
  704. if Distance > 999 then return false; end
  705.  
  706. local _Ray = Ray.new(Position, Unit * Distance);
  707.  
  708. local List = {LocalPlayer.Character, Camera, Mouse.TargetFilter};
  709.  
  710. for i,v in pairs(IgnoreList) do table.insert(List, v); end;
  711.  
  712. local Hit = workspace:FindPartOnRayWithIgnoreList(_Ray, List);
  713. if Hit and not Hit:IsDescendantOf(Player.Character) then
  714. Pass = false;
  715. if Hit.Transparency >= .3 or not Hit.CanCollide and Hit.ClassName ~= Terrain then -- Detect invisible walls
  716. IgnoreList[#IgnoreList + 1] = Hit;
  717. end
  718. end
  719.  
  720. return Pass;
  721. end
  722.  
  723. function CheckTeam(Player)
  724. return Player.TeamColor == LocalPlayer.TeamColor;
  725. end
  726.  
  727. local CustomTeam = CustomTeams[game.PlaceId];
  728.  
  729. if CustomTeam ~= nil then
  730. ypcall(CustomTeam.Initialize);
  731. CheckTeam = CustomTeam.CheckTeam;
  732. end
  733.  
  734. function CheckPlayer(Player)
  735. if not Options.Enabled.Value then return false end
  736.  
  737. local Pass = true;
  738. local Distance = 0;
  739.  
  740. if Player ~= LocalPlayer and Player.Character then
  741. if not Options.ShowTeam.Value and CheckTeam(Player) then
  742. Pass = false;
  743. end
  744.  
  745. local Head = Player.Character:FindFirstChild'Head';
  746.  
  747. if Pass and Player.Character and Head then
  748. Distance = (Camera.CFrame.p - Head.Position).magnitude;
  749. if Options.VisCheck.Value then
  750. Pass = CheckRay(Player, Distance, Camera.CFrame.p, (Head.Position - Camera.CFrame.p).unit);
  751. end
  752. if Distance > Options.MaxDistance.Value then
  753. Pass = false;
  754. end
  755. end
  756. else
  757. Pass = false;
  758. end
  759.  
  760. return Pass, Distance;
  761. end
  762.  
  763. function UpdatePlayerData()
  764. if (tick() - LastRefresh) > (Options.RefreshRate.Value / 1000) then
  765. LastRefresh = tick();
  766. for i, v in pairs(Players:GetPlayers()) do
  767. local Data = shared.PlayerData[v.Name] or { Instances = {} };
  768.  
  769. Data.Instances['Box'] = Data.Instances['Box'] or LineBox:Create{Thickness = 3};
  770. Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
  771. Transparency = 1;
  772. Thickness = 2;
  773. }
  774. Data.Instances['HeadDot'] = Data.Instances['HeadDot'] or NewDrawing'Circle'{
  775. Filled = true;
  776. NumSides = 30;
  777. }
  778. Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
  779. Size = Options.TextSize.Value;
  780. Center = true;
  781. Outline = Options.TextOutline.Value;
  782. Visible = true;
  783. };
  784. Data.Instances['DistanceHealthTag'] = Data.Instances['DistanceHealthTag'] or NewDrawing'Text'{
  785. Size = Options.TextSize.Value - 1;
  786. Center = true;
  787. Outline = Options.TextOutline.Value;
  788. Visible = true;
  789. };
  790.  
  791. local NameTag = Data.Instances['NameTag'];
  792. local DistanceTag = Data.Instances['DistanceHealthTag'];
  793. local Tracer = Data.Instances['Tracer'];
  794. local HeadDot = Data.Instances['HeadDot'];
  795. local Box = Data.Instances['Box'];
  796.  
  797. local Pass, Distance = CheckPlayer(v);
  798.  
  799. if Pass and v.Character then
  800. Data.LastUpdate = tick();
  801. local Humanoid = v.Character:FindFirstChildOfClass'Humanoid';
  802. local Head = v.Character:FindFirstChild'Head';
  803. local HumanoidRootPart = v.Character:FindFirstChild'HumanoidRootPart';
  804. if v.Character ~= nil and Head then
  805. local ScreenPosition, Vis = Camera:WorldToViewportPoint(Head.Position);
  806. if Vis then
  807. local Color = CheckTeam(v) and Green or Red;
  808.  
  809. local ScreenPositionUpper = Camera:WorldToViewportPoint(Head.CFrame * CFrame.new(0, Head.Size.Y, 0).p);
  810. local Scale = Head.Size.Y / 2;
  811.  
  812. if Options.ShowName.Value then
  813. NameTag.Visible = true;
  814. NameTag.Text = v.Name;
  815. NameTag.Size = Options.TextSize.Value;
  816. NameTag.Outline = Options.TextOutline.Value;
  817. NameTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y);
  818. NameTag.Color = Color;
  819. if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
  820. NameTag.Font = Drawing.Fonts.UI;
  821. end
  822. else
  823. NameTag.Visible = false;
  824. end
  825. if Options.ShowDistance.Value or Options.ShowHealth.Value then
  826. DistanceTag.Visible = true;
  827. DistanceTag.Size = Options.TextSize.Value - 1;
  828. DistanceTag.Outline = Options.TextOutline.Value;
  829. DistanceTag.Color = Color3.new(1, 1, 1);
  830. if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
  831. NameTag.Font = Drawing.Fonts.UI;
  832. end
  833.  
  834. local Str = '';
  835.  
  836. if Options.ShowDistance.Value then
  837. Str = Str .. Format('[%d] ', Distance);
  838. end
  839. if Options.ShowHealth.Value and Humanoid then
  840. Str = Str .. Format('[%d/100]', Humanoid.Health / Humanoid.MaxHealth * 100);
  841. end
  842.  
  843. DistanceTag.Text = Str;
  844. DistanceTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y) + Vector2.new(0, NameTag.Size);
  845. else
  846. DistanceTag.Visible = false;
  847. end
  848. if Options.ShowDot.Value then
  849. local Top = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, Scale, 0)).p);
  850. local Bottom = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, -Scale, 0)).p);
  851. local Radius = (Top - Bottom).y;
  852.  
  853. HeadDot.Visible = true;
  854. HeadDot.Color = Color;
  855. HeadDot.Position = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
  856. HeadDot.Radius = Radius;
  857. else
  858. HeadDot.Visible = false;
  859. end
  860. if Options.ShowTracers.Value then
  861. Tracer.Visible = true;
  862. Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
  863. Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
  864. Tracer.Color = Color;
  865. else
  866. Tracer.Visible = false;
  867. end
  868. if Options.ShowBoxes.Value and HumanoidRootPart then
  869. Box:Update(HumanoidRootPart.CFrame, Vector3.new(2, 3, 0) * (Scale * 2), Color);
  870. else
  871. Box:SetVisible(false);
  872. end
  873. else
  874. NameTag.Visible = false;
  875. DistanceTag.Visible = false;
  876. Tracer.Visible = false;
  877. HeadDot.Visible = false;
  878.  
  879. Box:SetVisible(false);
  880. end
  881. end
  882. else
  883. NameTag.Visible = false;
  884. DistanceTag.Visible = false;
  885. Tracer.Visible = false;
  886. HeadDot.Visible = false;
  887.  
  888. Box:SetVisible(false);
  889. end
  890.  
  891. shared.PlayerData[v.Name] = Data;
  892. end
  893. end
  894. end
  895.  
  896. function Update()
  897. for i, v in pairs(shared.PlayerData) do
  898. if not Players:FindFirstChild(tostring(i)) then
  899. GetTableData(v.Instances)(function(i, obj)
  900. obj.Visible = false;
  901. obj:Remove();
  902. v.Instances[i] = nil;
  903. end)
  904. shared.PlayerData[i] = nil;
  905. end
  906. end
  907.  
  908. local CX = Menu:GetInstance'CrosshairX';
  909. local CY = Menu:GetInstance'CrosshairY';
  910. if Options.Crosshair.Value then
  911. CX.Visible = true;
  912. CY.Visible = true;
  913.  
  914. CX.To = Vector2.new((Camera.ViewportSize.X / 2) - 8, (Camera.ViewportSize.Y / 2));
  915. CX.From = Vector2.new((Camera.ViewportSize.X / 2) + 8, (Camera.ViewportSize.Y / 2));
  916. CY.To = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) - 8);
  917. CY.From = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) + 8);
  918. else
  919. CX.Visible = false;
  920. CY.Visible = false;
  921. end
  922.  
  923. if Options.MenuOpen.Value and MenuLoaded then
  924. local MLocation = GetMouseLocation();
  925. shared.MenuDrawingData.Instances.Main.Color = Color3.fromHSV(tick() * 24 % 255/255, 1, 1);
  926. local MainInstance = Menu:GetInstance'Main';
  927. local Values = {
  928. MainInstance.Position.X;
  929. MainInstance.Position.Y;
  930. MainInstance.Position.X + MainInstance.Size.X;
  931. MainInstance.Position.Y + MainInstance.Size.Y;
  932. };
  933. if MainInstance and MouseHoveringOver(Values) then
  934. Debounce.CursorVis = true;
  935. -- GUIService:SetMenuIsOpen(true);
  936. Menu:UpdateMenuInstance'Cursor1'{
  937. Visible = true;
  938. From = Vector2.new(MLocation.x, MLocation.y);
  939. To = Vector2.new(MLocation.x + 5, MLocation.y + 6);
  940. }
  941. Menu:UpdateMenuInstance'Cursor2'{
  942. Visible = true;
  943. From = Vector2.new(MLocation.x, MLocation.y);
  944. To = Vector2.new(MLocation.x, MLocation.y + 8);
  945. }
  946. Menu:UpdateMenuInstance'Cursor3'{
  947. Visible = true;
  948. From = Vector2.new(MLocation.x, MLocation.y + 6);
  949. To = Vector2.new(MLocation.x + 5, MLocation.y + 5);
  950. }
  951. else
  952. if Debounce.CursorVis then
  953. Debounce.CursorVis = false;
  954. -- GUIService:SetMenuIsOpen(false);
  955. Menu:UpdateMenuInstance'Cursor1'{Visible = false};
  956. Menu:UpdateMenuInstance'Cursor2'{Visible = false};
  957. Menu:UpdateMenuInstance'Cursor3'{Visible = false};
  958. end
  959. end
  960. if MouseHeld then
  961. if Dragging then
  962. DraggingWhat.Slider.Position = Vector2.new(math.clamp(MLocation.X, DraggingWhat.Line.From.X, DraggingWhat.Line.To.X), DraggingWhat.Slider.Position.Y);
  963. local Percent = (DraggingWhat.Slider.Position.X - DraggingWhat.Line.From.X) / ((DraggingWhat.Line.To.X - DraggingWhat.Line.From.X));
  964. local Value = CalculateValue(DraggingWhat.Min, DraggingWhat.Max, Percent);
  965. DraggingWhat.Option(Value);
  966. elseif DraggingUI then
  967. Debounce.UIDrag = true;
  968. local Main = Menu:GetInstance'Main';
  969. local MousePos = GetMouseLocation();
  970. Main.Position = MousePos + DragOffset;
  971. end
  972. else
  973. Dragging = false;
  974. if DraggingUI and Debounce.UIDrag then
  975. Debounce.UIDrag = false;
  976. DraggingUI = false;
  977. CreateMenu(Menu:GetInstance'Main'.Position);
  978. end
  979. end
  980. if not Debounce.Menu then
  981. Debounce.Menu = true;
  982. ToggleMenu();
  983. end
  984. elseif Debounce.Menu and not Options.MenuOpen.Value then
  985. Debounce.Menu = false;
  986. ToggleMenu();
  987. end
  988. end
  989.  
  990. RunService:UnbindFromRenderStep(GetDataName);
  991. RunService:UnbindFromRenderStep(UpdateName);
  992.  
  993. RunService:BindToRenderStep(GetDataName, 1, UpdatePlayerData);
  994. RunService:BindToRenderStep(UpdateName, 1, Update);
Advertisement
Add Comment
Please, Sign In to add comment