Advertisement
Jjgames

Kiwii's Universal [SOURCE CODE]

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