eruaaaaaaa

Untitled

Jun 13th, 2022 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 94.22 KB | None | 0 0
  1. local InputService = game:GetService('UserInputService');
  2. local TextService = game:GetService('TextService');
  3. local TweenService = game:GetService('TweenService');
  4. local CoreGui = game:GetService('CoreGui');
  5. local RunService = game:GetService('RunService')
  6. local RenderStepped = RunService.RenderStepped;
  7. local LocalPlayer = game:GetService('Players').LocalPlayer;
  8. local Mouse = LocalPlayer:GetMouse();
  9.  
  10. local ProtectGui = protectgui or (syn and syn.protect_gui) or (function() end);
  11.  
  12. local ScreenGui = Instance.new('ScreenGui');
  13. ProtectGui(ScreenGui);
  14.  
  15. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Global;
  16. ScreenGui.Parent = LocalPlayer.PlayerGui;
  17.  
  18. local Toggles = {};
  19. local Options = {};
  20.  
  21. getgenv().Toggles = Toggles;
  22. getgenv().Options = Options;
  23.  
  24. local Library = {
  25. Registry = {};
  26. RegistryMap = {};
  27.  
  28. HudRegistry = {};
  29.  
  30. FontColor = Color3.fromRGB(255, 255, 255);
  31. MainColor = Color3.fromRGB(28, 28, 28);
  32. BackgroundColor = Color3.fromRGB(20, 20, 20);
  33. AccentColor = Color3.fromRGB(0, 85, 255);
  34. OutlineColor = Color3.fromRGB(50, 50, 50);
  35.  
  36. Black = Color3.new(0, 0, 0);
  37.  
  38. OpenedFrames = {};
  39.  
  40. Signals = {};
  41. ScreenGui = ScreenGui;
  42. };
  43.  
  44. local RainbowStep = 0
  45. local Hue = 0
  46.  
  47. table.insert(Library.Signals, RenderStepped:Connect(function(Delta)
  48. RainbowStep = RainbowStep + Delta
  49.  
  50. if RainbowStep >= (1 / 60) then
  51. RainbowStep = 0
  52.  
  53. Hue = Hue + (1 / 400);
  54.  
  55. if Hue > 1 then
  56. Hue = 0;
  57. end;
  58.  
  59. Library.CurrentRainbowHue = Hue;
  60. Library.CurrentRainbowColor = Color3.fromHSV(Hue, 0.8, 1);
  61. end
  62. end))
  63.  
  64. function Library:AttemptSave()
  65. if Library.SaveManager then
  66. Library.SaveManager:Save();
  67. end;
  68. end;
  69.  
  70. function Library:Create(Class, Properties)
  71. local _Instance = Class;
  72.  
  73. if type(Class) == 'string' then
  74. _Instance = Instance.new(Class);
  75. end;
  76.  
  77. for Property, Value in next, Properties do
  78. _Instance[Property] = Value;
  79. end;
  80.  
  81. return _Instance;
  82. end;
  83.  
  84. function Library:CreateLabel(Properties, IsHud)
  85. local _Instance = Library:Create('TextLabel', {
  86. BackgroundTransparency = 1;
  87. Font = Enum.Font.Code;
  88. TextColor3 = Library.FontColor;
  89. TextSize = 16;
  90. TextStrokeTransparency = 0;
  91. });
  92.  
  93. Library:AddToRegistry(_Instance, {
  94. TextColor3 = 'FontColor';
  95. }, IsHud);
  96.  
  97. return Library:Create(_Instance, Properties);
  98. end;
  99.  
  100. function Library:MakeDraggable(Instance, Cutoff)
  101. Instance.Active = true;
  102.  
  103. Instance.InputBegan:Connect(function(Input)
  104. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  105. local ObjPos = Vector2.new(
  106. Mouse.X - Instance.AbsolutePosition.X,
  107. Mouse.Y - Instance.AbsolutePosition.Y
  108. );
  109.  
  110. if ObjPos.Y > (Cutoff or 40) then
  111. return;
  112. end;
  113.  
  114. while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  115. Instance.Position = UDim2.new(
  116. 0,
  117. Mouse.X - ObjPos.X + (Instance.Size.X.Offset * Instance.AnchorPoint.X),
  118. 0,
  119. Mouse.Y - ObjPos.Y + (Instance.Size.Y.Offset * Instance.AnchorPoint.Y)
  120. );
  121.  
  122. RenderStepped:Wait();
  123. end;
  124. end;
  125. end)
  126. end;
  127.  
  128. function Library:AddToolTip(InfoStr, HoverInstance)
  129. local X, Y = Library:GetTextBounds(InfoStr, Enum.Font.Code, 14);
  130. local Tooltip = Library:Create('Frame', {
  131. BackgroundColor3 = Library.MainColor,
  132. BorderColor3 = Library.OutlineColor,
  133.  
  134. Size = UDim2.fromOffset(X + 5, Y + 4),
  135. ZIndex = 11;
  136. Parent = Library.ScreenGui,
  137.  
  138. Visible = false,
  139. })
  140.  
  141. local Label = Library:CreateLabel({
  142. Position = UDim2.fromOffset(3, 1),
  143. Size = UDim2.fromOffset(X, Y);
  144. TextSize = 14;
  145. Text = InfoStr,
  146. TextColor3 = Library.FontColor,
  147. TextXAlignment = Enum.TextXAlignment.Left;
  148. ZIndex = 12;
  149.  
  150. Parent = Tooltip;
  151. });
  152.  
  153. Library:AddToRegistry(Tooltip, {
  154. BackgroundColor3 = 'MainColor';
  155. BorderColor3 = 'OutlineColor';
  156. });
  157.  
  158. Library:AddToRegistry(Label, {
  159. TextColor3 = 'FontColor',
  160. });
  161.  
  162. local IsHovering = false
  163. HoverInstance.MouseEnter:Connect(function()
  164. IsHovering = true
  165.  
  166. Tooltip.Position = UDim2.fromOffset(Mouse.X + 15, Mouse.Y + 12)
  167. Tooltip.Visible = true
  168.  
  169. while IsHovering do
  170. RunService.Heartbeat:Wait()
  171. Tooltip.Position = UDim2.fromOffset(Mouse.X + 15, Mouse.Y + 12)
  172. end
  173. end)
  174.  
  175. HoverInstance.MouseLeave:Connect(function()
  176. IsHovering = false
  177. Tooltip.Visible = false
  178. end)
  179. end
  180.  
  181. function Library:OnHighlight(HighlightInstance, Instance, Properties, PropertiesDefault)
  182. HighlightInstance.MouseEnter:Connect(function()
  183. local Reg = Library.RegistryMap[Instance];
  184.  
  185. for Property, ColorIdx in next, Properties do
  186. Instance[Property] = Library[ColorIdx] or ColorIdx;
  187.  
  188. if Reg and Reg.Properties[Property] then
  189. Reg.Properties[Property] = ColorIdx;
  190. end;
  191. end;
  192. end)
  193.  
  194. HighlightInstance.MouseLeave:Connect(function()
  195. local Reg = Library.RegistryMap[Instance];
  196.  
  197. for Property, ColorIdx in next, PropertiesDefault do
  198. Instance[Property] = Library[ColorIdx] or ColorIdx;
  199.  
  200. if Reg and Reg.Properties[Property] then
  201. Reg.Properties[Property] = ColorIdx;
  202. end;
  203. end;
  204. end)
  205. end;
  206.  
  207. function Library:MouseIsOverOpenedFrame()
  208. for Frame, _ in next, Library.OpenedFrames do
  209. local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
  210.  
  211. if Mouse.X >= AbsPos.X and Mouse.X <= AbsPos.X + AbsSize.X
  212. and Mouse.Y >= AbsPos.Y and Mouse.Y <= AbsPos.Y + AbsSize.Y then
  213.  
  214. return true;
  215. end;
  216. end;
  217. end;
  218.  
  219. function Library:MapValue(Value, MinA, MaxA, MinB, MaxB)
  220. return (1 - ((Value - MinA) / (MaxA - MinA))) * MinB + ((Value - MinA) / (MaxA - MinA)) * MaxB;
  221. end;
  222.  
  223. function Library:GetTextBounds(Text, Font, Size, Resolution)
  224. local Bounds = TextService:GetTextSize(Text, Size, Font, Resolution or Vector2.new(1920, 1080))
  225. return Bounds.X, Bounds.Y
  226. end;
  227.  
  228. function Library:GetDarkerColor(Color)
  229. local H, S, V = Color3.toHSV(Color);
  230. return Color3.fromHSV(H, S, V / 1.5);
  231. end;
  232. Library.AccentColorDark = Library:GetDarkerColor(Library.AccentColor);
  233.  
  234. function Library:AddToRegistry(Instance, Properties, IsHud)
  235. local Idx = #Library.Registry + 1;
  236. local Data = {
  237. Instance = Instance;
  238. Properties = Properties;
  239. Idx = Idx;
  240. };
  241.  
  242. table.insert(Library.Registry, Data);
  243. Library.RegistryMap[Instance] = Data;
  244.  
  245. if IsHud then
  246. table.insert(Library.HudRegistry, Data);
  247. end;
  248. end;
  249.  
  250. function Library:RemoveFromRegistry(Instance)
  251. local Data = Library.RegistryMap[Instance];
  252.  
  253. if Data then
  254. for Idx = #Library.Registry, 1, -1 do
  255. if Library.Registry[Idx] == Data then
  256. table.remove(Library.Registry, Idx);
  257. end;
  258. end;
  259.  
  260. for Idx = #Library.HudRegistry, 1, -1 do
  261. if Library.HudRegistry[Idx] == Data then
  262. table.remove(Library.HudRegistry, Idx);
  263. end;
  264. end;
  265.  
  266. Library.RegistryMap[Instance] = nil;
  267. end;
  268. end;
  269.  
  270. function Library:UpdateColorsUsingRegistry()
  271. -- TODO: Could have an 'active' list of objects
  272. -- where the active list only contains Visible objects.
  273.  
  274. -- IMPL: Could setup .Changed events on the AddToRegistry function
  275. -- that listens for the 'Visible' propert being changed.
  276. -- Visible: true => Add to active list, and call UpdateColors function
  277. -- Visible: false => Remove from active list.
  278.  
  279. -- The above would be especially efficient for a rainbow menu color or live color-changing.
  280.  
  281. for Idx, Object in next, Library.Registry do
  282. for Property, ColorIdx in next, Object.Properties do
  283. if type(ColorIdx) == 'string' then
  284. Object.Instance[Property] = Library[ColorIdx];
  285. elseif type(ColorIdx) == 'function' then
  286. Object.Instance[Property] = ColorIdx()
  287. end
  288. end;
  289. end;
  290. end;
  291.  
  292. function Library:GiveSignal(Signal)
  293. -- Only used for signals not attached to library instances, as those should be cleaned up on object destruction by Roblox
  294. table.insert(Library.Signals, Signal)
  295. end
  296.  
  297. function Library:Unload()
  298. -- Unload all of the signals
  299. for Idx = #Library.Signals, 1, -1 do
  300. local Connection = table.remove(Library.Signals, Idx)
  301. Connection:Disconnect()
  302. end
  303.  
  304. -- Call our unload callback, maybe to undo some hooks etc
  305. if Library.OnUnload then
  306. Library.OnUnload()
  307. end
  308.  
  309. ScreenGui:Destroy()
  310. end
  311.  
  312. function Library:OnUnload(Callback)
  313. Library.OnUnload = Callback
  314. end
  315.  
  316. Library:GiveSignal(ScreenGui.DescendantRemoving:Connect(function(Instance)
  317. if Library.RegistryMap[Instance] then
  318. Library:RemoveFromRegistry(Instance);
  319. end;
  320. end))
  321.  
  322. local BaseAddons = {};
  323.  
  324. do
  325. local Funcs = {};
  326.  
  327. function Funcs:AddColorPicker(Idx, Info)
  328. local ToggleLabel = self.TextLabel;
  329. local Container = self.Container;
  330.  
  331. local ColorPicker = {
  332. Value = Info.Default;
  333. Type = 'ColorPicker';
  334. Title = type(Info.Title) == 'string' and Info.Title or 'Color picker',
  335. };
  336.  
  337. function ColorPicker:SetHSVFromRGB(Color)
  338. local H, S, V = Color3.toHSV(Color);
  339.  
  340. ColorPicker.Hue = H;
  341. ColorPicker.Sat = S;
  342. ColorPicker.Vib = V;
  343. end;
  344.  
  345. ColorPicker:SetHSVFromRGB(ColorPicker.Value);
  346.  
  347. local DisplayFrame = Library:Create('Frame', {
  348. BackgroundColor3 = ColorPicker.Value;
  349. BorderColor3 = Library:GetDarkerColor(ColorPicker.Value);
  350. BorderMode = Enum.BorderMode.Inset;
  351. Size = UDim2.new(0, 28, 0, 14);
  352. ZIndex = 6;
  353. Parent = ToggleLabel;
  354. });
  355.  
  356. local RelativeOffset = 0;
  357.  
  358. for _, Element in next, Container:GetChildren() do
  359. if not Element:IsA('UIListLayout') then
  360. RelativeOffset = RelativeOffset + Element.Size.Y.Offset;
  361. end;
  362. end;
  363.  
  364. local PickerFrameOuter = Library:Create('Frame', {
  365. Name = 'Color';
  366. BackgroundColor3 = Color3.new(1, 1, 1);
  367. BorderColor3 = Color3.new(0, 0, 0);
  368. Position = UDim2.new(0, 4, 0, 20 + RelativeOffset + 1);
  369. Size = UDim2.new(1, -13, 0, 253);
  370. Visible = false;
  371. ZIndex = 15;
  372. Parent = Container.Parent;
  373. });
  374.  
  375. local PickerFrameInner = Library:Create('Frame', {
  376. BackgroundColor3 = Library.BackgroundColor;
  377. BorderColor3 = Library.OutlineColor;
  378. BorderMode = Enum.BorderMode.Inset;
  379. Size = UDim2.new(1, 0, 1, 0);
  380. ZIndex = 16;
  381. Parent = PickerFrameOuter;
  382. });
  383.  
  384. local Highlight = Library:Create('Frame', {
  385. BackgroundColor3 = Library.AccentColor;
  386. BorderSizePixel = 0;
  387. Size = UDim2.new(1, 0, 0, 2);
  388. ZIndex = 17;
  389. Parent = PickerFrameInner;
  390. });
  391.  
  392. local SatVibMapOuter = Library:Create('Frame', {
  393. BorderColor3 = Color3.new(0, 0, 0);
  394. Position = UDim2.new(0, 4, 0, 25);
  395. Size = UDim2.new(0, 200, 0, 200);
  396. ZIndex = 17;
  397. Parent = PickerFrameInner;
  398. });
  399.  
  400. local SatVibMapInner = Library:Create('Frame', {
  401. BackgroundColor3 = Library.BackgroundColor;
  402. BorderColor3 = Library.OutlineColor;
  403. BorderMode = Enum.BorderMode.Inset;
  404. Size = UDim2.new(1, 0, 1, 0);
  405. ZIndex = 18;
  406. Parent = SatVibMapOuter;
  407. });
  408.  
  409. local SatVibMap = Library:Create('ImageLabel', {
  410. BorderSizePixel = 0;
  411. Size = UDim2.new(1, 0, 1, 0);
  412. ZIndex = 18;
  413. Image = 'rbxassetid://4155801252';
  414. Parent = SatVibMapInner;
  415. });
  416.  
  417. local HueSelectorOuter = Library:Create('Frame', {
  418. BorderColor3 = Color3.new(0, 0, 0);
  419. Position = UDim2.new(0, 208, 0, 25);
  420. Size = UDim2.new(0, 15, 0, 200);
  421. ZIndex = 17;
  422. Parent = PickerFrameInner;
  423. });
  424.  
  425. local HueSelectorInner = Library:Create('Frame', {
  426. BackgroundColor3 = Color3.new(1, 1, 1);
  427. BorderSizePixel = 0;
  428. Size = UDim2.new(1, 0, 1, 0);
  429. ZIndex = 18;
  430. Parent = HueSelectorOuter;
  431. });
  432.  
  433. local HueTextSize = Library:GetTextBounds('Hex color', Enum.Font.Code, 16) + 3
  434. local RgbTextSize = Library:GetTextBounds('255, 255, 255', Enum.Font.Code, 16) + 3
  435.  
  436. local HueBoxOuter = Library:Create('Frame', {
  437. BorderColor3 = Color3.new(0, 0, 0);
  438. Position = UDim2.fromOffset(4, 228),
  439. Size = UDim2.new(0.5, -6, 0, 20),
  440. ZIndex = 18,
  441. Parent = PickerFrameInner;
  442. });
  443.  
  444. local HueBoxInner = Library:Create('Frame', {
  445. BackgroundColor3 = Library.MainColor;
  446. BorderColor3 = Library.OutlineColor;
  447. BorderMode = Enum.BorderMode.Inset;
  448. Size = UDim2.new(1, 0, 1, 0);
  449. ZIndex = 18,
  450. Parent = HueBoxOuter;
  451. });
  452.  
  453. Library:Create('UIGradient', {
  454. Color = ColorSequence.new({
  455. ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  456. ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  457. });
  458. Rotation = 90;
  459. Parent = HueBoxInner;
  460. });
  461.  
  462. local HueBox = Library:Create('TextBox', {
  463. BackgroundTransparency = 1;
  464. Position = UDim2.new(0, 5, 0, 0);
  465. Size = UDim2.new(1, -5, 1, 0);
  466. Font = Enum.Font.Code;
  467. PlaceholderColor3 = Color3.fromRGB(190, 190, 190);
  468. PlaceholderText = 'Hex color',
  469. Text = '#FFFFFF',
  470. TextColor3 = Library.FontColor;
  471. TextSize = 14;
  472. TextStrokeTransparency = 0;
  473. TextXAlignment = Enum.TextXAlignment.Left;
  474. ZIndex = 20,
  475. Parent = HueBoxInner;
  476. });
  477.  
  478. local RgbBoxBase = Library:Create(HueBoxOuter:Clone(), {
  479. Position = UDim2.new(0.5, 2, 0, 228),
  480. Size = UDim2.new(0.5, -6, 0, 20),
  481. Parent = PickerFrameInner
  482. })
  483.  
  484. local RgbBox = Library:Create(RgbBoxBase.Frame:FindFirstChild('TextBox'), {
  485. Text = '255, 255, 255',
  486. PlaceholderText = 'RGB color',
  487. TextColor3 = Library.FontColor,
  488. })
  489.  
  490. local DisplayLabel = Library:CreateLabel({
  491. Size = UDim2.new(1, 0, 0, 14);
  492. Position = UDim2.fromOffset(5, 5);
  493. TextXAlignment = Enum.TextXAlignment.Left;
  494. TextSize = 14;
  495. Text = ColorPicker.Title,--Info.Default;
  496. TextWrapped = false;
  497. ZIndex = 16;
  498. Parent = PickerFrameInner;
  499. });
  500.  
  501.  
  502. Library:AddToRegistry(PickerFrameInner, { BackgroundColor3 = 'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
  503. Library:AddToRegistry(Highlight, { BackgroundColor3 = 'AccentColor'; });
  504. Library:AddToRegistry(SatVibMapInner, { BackgroundColor3 = 'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
  505.  
  506. Library:AddToRegistry(HueBoxInner, { BackgroundColor3 = 'MainColor'; BorderColor3 = 'OutlineColor'; });
  507. Library:AddToRegistry(RgbBoxBase.Frame, { BackgroundColor3 = 'MainColor'; BorderColor3 = 'OutlineColor'; });
  508. Library:AddToRegistry(RgbBox, { TextColor3 = 'FontColor', });
  509. Library:AddToRegistry(HueBox, { TextColor3 = 'FontColor', });
  510.  
  511. local SequenceTable = {};
  512.  
  513. for Hue = 0, 1, 0.1 do
  514. table.insert(SequenceTable, ColorSequenceKeypoint.new(Hue, Color3.fromHSV(Hue, 1, 1)));
  515. end;
  516.  
  517. local HueSelectorGradient = Library:Create('UIGradient', {
  518. Color = ColorSequence.new(SequenceTable);
  519. Rotation = 90;
  520. Parent = HueSelectorInner;
  521. });
  522.  
  523. HueBox.FocusLost:Connect(function(enter)
  524. if enter then
  525. local success, result = pcall(Color3.fromHex, HueBox.Text)
  526. if success and typeof(result) == 'Color3' then
  527. ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib = Color3.toHSV(result)
  528. end
  529. end
  530.  
  531. ColorPicker:Display()
  532. end)
  533.  
  534. RgbBox.FocusLost:Connect(function(enter)
  535. if enter then
  536. local r, g, b = RgbBox.Text:match('(%d+),%s*(%d+),%s*(%d+)')
  537. if r and g and b then
  538. ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib = Color3.toHSV(Color3.fromRGB(r, g, b))
  539. end
  540. end
  541.  
  542. ColorPicker:Display()
  543. end)
  544.  
  545. function ColorPicker:Display()
  546. ColorPicker.Value = Color3.fromHSV(ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib);
  547. SatVibMap.BackgroundColor3 = Color3.fromHSV(ColorPicker.Hue, 1, 1);
  548.  
  549. Library:Create(DisplayFrame, {
  550. BackgroundColor3 = ColorPicker.Value;
  551. BorderColor3 = Library:GetDarkerColor(ColorPicker.Value);
  552. });
  553.  
  554. HueBox.Text = '#' .. ColorPicker.Value:ToHex()
  555. RgbBox.Text = table.concat({ math.floor(ColorPicker.Value.R * 255), math.floor(ColorPicker.Value.G * 255), math.floor(ColorPicker.Value.B * 255) }, ', ')
  556.  
  557. if ColorPicker.Changed then
  558. ColorPicker.Changed();
  559. end;
  560. end;
  561.  
  562. function ColorPicker:OnChanged(Func)
  563. ColorPicker.Changed = Func;
  564. Func();
  565. end;
  566.  
  567. function ColorPicker:Show()
  568. for Frame, Val in next, Library.OpenedFrames do
  569. if Frame.Name == 'Color' then
  570. Frame.Visible = false;
  571. Library.OpenedFrames[Frame] = nil;
  572. end;
  573. end;
  574.  
  575. PickerFrameOuter.Visible = true;
  576. Library.OpenedFrames[PickerFrameOuter] = true;
  577. end;
  578.  
  579. function ColorPicker:Hide()
  580. PickerFrameOuter.Visible = false;
  581. Library.OpenedFrames[PickerFrameOuter] = nil;
  582. end;
  583.  
  584. function ColorPicker:SetValue(HSV)
  585. local Color = Color3.fromHSV(HSV[1], HSV[2], HSV[3]);
  586.  
  587. ColorPicker:SetHSVFromRGB(Color);
  588. ColorPicker:Display();
  589. end;
  590.  
  591. function ColorPicker:SetValueRGB(Color)
  592. ColorPicker:SetHSVFromRGB(Color);
  593. ColorPicker:Display();
  594. end;
  595.  
  596. SatVibMap.InputBegan:Connect(function(Input)
  597. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  598. while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  599. local MinX = SatVibMap.AbsolutePosition.X;
  600. local MaxX = MinX + SatVibMap.AbsoluteSize.X;
  601. local MouseX = math.clamp(Mouse.X, MinX, MaxX);
  602.  
  603. local MinY = SatVibMap.AbsolutePosition.Y;
  604. local MaxY = MinY + SatVibMap.AbsoluteSize.Y;
  605. local MouseY = math.clamp(Mouse.Y, MinY, MaxY);
  606.  
  607. ColorPicker.Sat = (MouseX - MinX) / (MaxX - MinX);
  608. ColorPicker.Vib = 1 - ((MouseY - MinY) / (MaxY - MinY));
  609. ColorPicker:Display();
  610.  
  611. RenderStepped:Wait();
  612. end;
  613.  
  614. Library:AttemptSave();
  615. end;
  616. end);
  617.  
  618. HueSelectorInner.InputBegan:Connect(function(Input)
  619. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  620. while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  621. local MinY = HueSelectorInner.AbsolutePosition.Y;
  622. local MaxY = MinY + HueSelectorInner.AbsoluteSize.Y;
  623. local MouseY = math.clamp(Mouse.Y, MinY, MaxY);
  624.  
  625. ColorPicker.Hue = ((MouseY - MinY) / (MaxY - MinY));
  626. ColorPicker:Display();
  627.  
  628. RenderStepped:Wait();
  629. end;
  630.  
  631. Library:AttemptSave();
  632. end;
  633. end);
  634.  
  635. DisplayFrame.InputBegan:Connect(function(Input)
  636. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  637. if PickerFrameOuter.Visible then
  638. ColorPicker:Hide();
  639. else
  640. ColorPicker:Show();
  641. end;
  642. end;
  643. end);
  644.  
  645. Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
  646. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  647. local AbsPos, AbsSize = PickerFrameOuter.AbsolutePosition, PickerFrameOuter.AbsoluteSize;
  648.  
  649. if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  650. or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  651.  
  652. ColorPicker:Hide();
  653. end;
  654. end;
  655. end))
  656.  
  657. ColorPicker:Display();
  658.  
  659. Options[Idx] = ColorPicker;
  660.  
  661. return self;
  662. end;
  663.  
  664. function Funcs:AddKeyPicker(Idx, Info)
  665. local ParentObj = self;
  666. local ToggleLabel = self.TextLabel;
  667. local Container = self.Container;
  668.  
  669. local KeyPicker = {
  670. Value = Info.Default;
  671. Toggled = false;
  672. Mode = Info.Mode or 'Toggle'; -- Always, Toggle, Hold
  673. Type = 'KeyPicker';
  674.  
  675. SyncToggleState = Info.SyncToggleState or false;
  676. };
  677.  
  678. if KeyPicker.SyncToggleState then
  679. Info.Modes = { 'Toggle' }
  680. Info.Mode = 'Toggle'
  681. end
  682.  
  683. local RelativeOffset = 0;
  684.  
  685. for _, Element in next, Container:GetChildren() do
  686. if not Element:IsA('UIListLayout') then
  687. RelativeOffset = RelativeOffset + Element.Size.Y.Offset;
  688. end;
  689. end;
  690.  
  691. local PickOuter = Library:Create('Frame', {
  692. BorderColor3 = Color3.new(0, 0, 0);
  693. Size = UDim2.new(0, 28, 0, 15);
  694. ZIndex = 6;
  695. Parent = ToggleLabel;
  696. });
  697.  
  698. local PickInner = Library:Create('Frame', {
  699. BackgroundColor3 = Library.BackgroundColor;
  700. BorderColor3 = Library.OutlineColor;
  701. BorderMode = Enum.BorderMode.Inset;
  702. Size = UDim2.new(1, 0, 1, 0);
  703. ZIndex = 7;
  704. Parent = PickOuter;
  705. });
  706.  
  707. Library:AddToRegistry(PickInner, {
  708. BackgroundColor3 = 'BackgroundColor';
  709. BorderColor3 = 'OutlineColor';
  710. });
  711.  
  712. local DisplayLabel = Library:CreateLabel({
  713. Size = UDim2.new(1, 0, 1, 0);
  714. TextSize = 13;
  715. Text = Info.Default;
  716. TextWrapped = true;
  717. ZIndex = 8;
  718. Parent = PickInner;
  719. });
  720.  
  721. local ModeSelectOuter = Library:Create('Frame', {
  722. BorderColor3 = Color3.new(0, 0, 0);
  723. Position = UDim2.new(1, 0, 0, RelativeOffset + 1);
  724. Size = UDim2.new(0, 60, 0, 45 + 2);
  725. Visible = false;
  726. ZIndex = 14;
  727. Parent = Container.Parent;
  728. });
  729.  
  730. local ModeSelectInner = Library:Create('Frame', {
  731. BackgroundColor3 = Library.BackgroundColor;
  732. BorderColor3 = Library.OutlineColor;
  733. BorderMode = Enum.BorderMode.Inset;
  734. Size = UDim2.new(1, 0, 1, 0);
  735. ZIndex = 15;
  736. Parent = ModeSelectOuter;
  737. });
  738.  
  739. Library:AddToRegistry(ModeSelectInner, {
  740. BackgroundColor3 = 'BackgroundColor';
  741. BorderColor3 = 'OutlineColor';
  742. });
  743.  
  744. Library:Create('UIListLayout', {
  745. FillDirection = Enum.FillDirection.Vertical;
  746. SortOrder = Enum.SortOrder.LayoutOrder;
  747. Parent = ModeSelectInner;
  748. });
  749.  
  750. local ContainerLabel = Library:CreateLabel({
  751. TextXAlignment = Enum.TextXAlignment.Left;
  752. Size = UDim2.new(1, 0, 0, 18);
  753. TextSize = 13;
  754. Visible = false;
  755. ZIndex = 110;
  756. Parent = Library.KeybindContainer;
  757. }, true);
  758.  
  759. local Modes = Info.Modes or { 'Always', 'Toggle', 'Hold' };
  760. local ModeButtons = {};
  761.  
  762. for Idx, Mode in next, Modes do
  763. local ModeButton = {};
  764.  
  765. local Label = Library:CreateLabel({
  766. Size = UDim2.new(1, 0, 0, 15);
  767. TextSize = 13;
  768. Text = Mode;
  769. ZIndex = 16;
  770. Parent = ModeSelectInner;
  771. });
  772.  
  773. function ModeButton:Select()
  774. for _, Button in next, ModeButtons do
  775. Button:Deselect();
  776. end;
  777.  
  778. KeyPicker.Mode = Mode;
  779.  
  780. Label.TextColor3 = Library.AccentColor;
  781. Library.RegistryMap[Label].Properties.TextColor3 = 'AccentColor';
  782.  
  783. ModeSelectOuter.Visible = false;
  784. end;
  785.  
  786. function ModeButton:Deselect()
  787. KeyPicker.Mode = nil;
  788.  
  789. Label.TextColor3 = Library.FontColor;
  790. Library.RegistryMap[Label].Properties.TextColor3 = 'FontColor';
  791. end;
  792.  
  793. Label.InputBegan:Connect(function(Input)
  794. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  795. ModeButton:Select();
  796. Library:AttemptSave();
  797. end;
  798. end);
  799.  
  800. if Mode == KeyPicker.Mode then
  801. ModeButton:Select();
  802. end;
  803.  
  804. ModeButtons[Mode] = ModeButton;
  805. end;
  806.  
  807. function KeyPicker:Update()
  808. if Info.NoUI then
  809. return;
  810. end;
  811.  
  812. local State = KeyPicker:GetState();
  813.  
  814. ContainerLabel.Text = string.format('[%s] %s (%s)', KeyPicker.Value, Info.Text, KeyPicker.Mode);
  815.  
  816. ContainerLabel.Visible = true;
  817. ContainerLabel.TextColor3 = State and Library.AccentColor or Library.FontColor;
  818.  
  819. Library.RegistryMap[ContainerLabel].Properties.TextColor3 = State and 'AccentColor' or 'FontColor';
  820.  
  821. local YSize = 0
  822. local XSize = 0
  823.  
  824. for _, Label in next, Library.KeybindContainer:GetChildren() do
  825. if Label:IsA('TextLabel') and Label.Visible then
  826. YSize = YSize + 18;
  827. if (Label.TextBounds.X > XSize) then
  828. XSize = Label.TextBounds.X
  829. end
  830. end;
  831. end;
  832.  
  833. Library.KeybindFrame.Size = UDim2.new(0, math.max(XSize + 10, 210), 0, YSize + 23)
  834. end;
  835.  
  836. function KeyPicker:GetState()
  837. if KeyPicker.Mode == 'Always' then
  838. return true;
  839. elseif KeyPicker.Mode == 'Hold' then
  840. local Key = KeyPicker.Value;
  841.  
  842. if Key == 'MB1' or Key == 'MB2' then
  843. return Key == 'MB1' and InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
  844. or Key == 'MB2' and InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2);
  845. else
  846. return InputService:IsKeyDown(Enum.KeyCode[KeyPicker.Value]);
  847. end;
  848. else
  849. return KeyPicker.Toggled;
  850. end;
  851. end;
  852.  
  853. function KeyPicker:SetValue(Data)
  854. local Key, Mode = Data[1], Data[2];
  855. DisplayLabel.Text = Key;
  856. KeyPicker.Value = Key;
  857. ModeButtons[Mode]:Select();
  858. KeyPicker:Update();
  859. end;
  860.  
  861. function KeyPicker:OnClick(Callback)
  862. KeyPicker.Clicked = Callback
  863. end
  864.  
  865.  
  866. if ParentObj.Addons then
  867. table.insert(ParentObj.Addons, KeyPicker)
  868. end
  869.  
  870. function KeyPicker:DoClick()
  871. if ParentObj.Type == 'Toggle' and KeyPicker.SyncToggleState then
  872. ParentObj:SetValue(not ParentObj.Value)
  873. end
  874.  
  875. if KeyPicker.Clicked then
  876. KeyPicker.Clicked()
  877. end
  878. end
  879.  
  880. local Picking = false;
  881.  
  882. PickOuter.InputBegan:Connect(function(Input)
  883. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  884. Picking = true;
  885.  
  886. DisplayLabel.Text = '';
  887.  
  888. local Break;
  889. local Text = '';
  890.  
  891. task.spawn(function()
  892. while (not Break) do
  893. if Text == '...' then
  894. Text = '';
  895. end;
  896.  
  897. Text = Text .. '.';
  898. DisplayLabel.Text = Text;
  899.  
  900. wait(0.4);
  901. end;
  902. end);
  903.  
  904. wait(0.2);
  905.  
  906. local Event;
  907. Event = InputService.InputBegan:Connect(function(Input)
  908. local Key;
  909.  
  910. if Input.UserInputType == Enum.UserInputType.Keyboard then
  911. Key = Input.KeyCode.Name;
  912. elseif Input.UserInputType == Enum.UserInputType.MouseButton1 then
  913. Key = 'MB1';
  914. elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
  915. Key = 'MB2';
  916. end;
  917.  
  918. Break = true;
  919. Picking = false;
  920.  
  921. DisplayLabel.Text = Key;
  922. KeyPicker.Value = Key;
  923.  
  924. Library:AttemptSave();
  925.  
  926. Event:Disconnect();
  927. end);
  928. elseif Input.UserInputType == Enum.UserInputType.MouseButton2 and not Library:MouseIsOverOpenedFrame() then
  929. ModeSelectOuter.Visible = true;
  930. end;
  931. end);
  932.  
  933. Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
  934. if (not Picking) then
  935. if KeyPicker.Mode == 'Toggle' then
  936. local Key = KeyPicker.Value;
  937.  
  938. if Key == 'MB1' or Key == 'MB2' then
  939. if Key == 'MB1' and Input.UserInputType == Enum.UserInputType.MouseButton1
  940. or Key == 'MB2' and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  941. KeyPicker.Toggled = not KeyPicker.Toggled
  942. KeyPicker:DoClick()
  943. end;
  944. elseif Input.UserInputType == Enum.UserInputType.Keyboard then
  945. if Input.KeyCode.Name == Key then
  946. KeyPicker.Toggled = not KeyPicker.Toggled;
  947. KeyPicker:DoClick()
  948. end;
  949. end;
  950. end;
  951.  
  952. KeyPicker:Update();
  953. end;
  954.  
  955. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  956. local AbsPos, AbsSize = ModeSelectOuter.AbsolutePosition, ModeSelectOuter.AbsoluteSize;
  957.  
  958. if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  959. or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  960.  
  961. ModeSelectOuter.Visible = false;
  962. end;
  963. end;
  964. end))
  965.  
  966. Library:GiveSignal(InputService.InputEnded:Connect(function(Input)
  967. if (not Picking) then
  968. KeyPicker:Update();
  969. end;
  970. end))
  971.  
  972. KeyPicker:Update();
  973.  
  974. Options[Idx] = KeyPicker;
  975.  
  976. return self;
  977. end;
  978.  
  979. BaseAddons.__index = Funcs;
  980. BaseAddons.__namecall = function(Table, Key, ...)
  981. return Funcs[Key](...);
  982. end;
  983. end;
  984.  
  985. local BaseGroupbox = {};
  986.  
  987. do
  988. local Funcs = {};
  989.  
  990. function Funcs:AddBlank(Size)
  991. local Groupbox = self;
  992. local Container = Groupbox.Container;
  993.  
  994. Library:Create('Frame', {
  995. BackgroundTransparency = 1;
  996. Size = UDim2.new(1, 0, 0, Size);
  997. ZIndex = 1;
  998. Parent = Container;
  999. });
  1000. end;
  1001.  
  1002. function Funcs:AddLabel(Text, DoesWrap)
  1003. local Label = {};
  1004.  
  1005. local Groupbox = self;
  1006. local Container = Groupbox.Container;
  1007.  
  1008. local TextLabel = Library:CreateLabel({
  1009. Size = UDim2.new(1, -4, 0, 15);
  1010. TextSize = 14;
  1011. Text = Text;
  1012. TextWrapped = DoesWrap or false,
  1013. RichText = true,
  1014. TextXAlignment = Enum.TextXAlignment.Left;
  1015. ZIndex = 5;
  1016. Parent = Container;
  1017. });
  1018.  
  1019. if DoesWrap then
  1020. local Y = select(2, Library:GetTextBounds(Text, Enum.Font.Code, 14, Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
  1021. TextLabel.Size = UDim2.new(1, -4, 0, Y)
  1022. else
  1023. Library:Create('UIListLayout', {
  1024. Padding = UDim.new(0, 4);
  1025. FillDirection = Enum.FillDirection.Horizontal;
  1026. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  1027. SortOrder = Enum.SortOrder.LayoutOrder;
  1028. Parent = TextLabel;
  1029. });
  1030. end
  1031.  
  1032. Label.TextLabel = TextLabel;
  1033. Label.Container = Container;
  1034.  
  1035. function Label:SetText(Text)
  1036. TextLabel.Text = Text
  1037.  
  1038. if DoesWrap then
  1039. local Y = select(2, Library:GetTextBounds(Text, Enum.Font.Code, 14, Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
  1040. TextLabel.Size = UDim2.new(1, -4, 0, Y)
  1041. end
  1042.  
  1043. Groupbox:Resize();
  1044. end
  1045.  
  1046. if (not DoesWrap) then
  1047. setmetatable(Label, BaseAddons);
  1048. end
  1049.  
  1050. Groupbox:AddBlank(5);
  1051. Groupbox:Resize();
  1052.  
  1053. return Label;
  1054. end;
  1055.  
  1056. function Funcs:AddButton(Text, Func)
  1057. local Button = {};
  1058.  
  1059. local Groupbox = self;
  1060. local Container = Groupbox.Container;
  1061.  
  1062. local ButtonOuter = Library:Create('Frame', {
  1063. BorderColor3 = Color3.new(0, 0, 0);
  1064. Size = UDim2.new(1, -4, 0, 20);
  1065. ZIndex = 5;
  1066. Parent = Container;
  1067. });
  1068.  
  1069. Library:AddToRegistry(ButtonOuter, {
  1070. BorderColor3 = 'Black';
  1071. });
  1072.  
  1073. local ButtonInner = Library:Create('Frame', {
  1074. BackgroundColor3 = Library.MainColor;
  1075. BorderColor3 = Library.OutlineColor;
  1076. BorderMode = Enum.BorderMode.Inset;
  1077. Size = UDim2.new(1, 0, 1, 0);
  1078. ZIndex = 6;
  1079. Parent = ButtonOuter;
  1080. });
  1081.  
  1082. Library:AddToRegistry(ButtonInner, {
  1083. BackgroundColor3 = 'MainColor';
  1084. BorderColor3 = 'OutlineColor';
  1085. });
  1086.  
  1087. Library:Create('UIGradient', {
  1088. Color = ColorSequence.new({
  1089. ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1090. ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1091. });
  1092. Rotation = 90;
  1093. Parent = ButtonInner;
  1094. });
  1095.  
  1096. local ButtonLabel = Library:CreateLabel({
  1097. Size = UDim2.new(1, 0, 1, 0);
  1098. TextSize = 14;
  1099. Text = Text;
  1100. ZIndex = 6;
  1101. Parent = ButtonInner;
  1102. });
  1103.  
  1104. Library:OnHighlight(ButtonOuter, ButtonOuter,
  1105. { BorderColor3 = 'AccentColor' },
  1106. { BorderColor3 = 'Black' }
  1107. );
  1108.  
  1109. ButtonOuter.InputBegan:Connect(function(Input)
  1110. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  1111. Func();
  1112. end;
  1113. end);
  1114.  
  1115. function Button:AddTooltip(tip)
  1116. if type(tip) == 'string' then
  1117. Library:AddToolTip(tip, ButtonOuter)
  1118. end
  1119. return Button
  1120. end
  1121.  
  1122. function Button:AddButton(Text, Func)
  1123. local SubButton = {}
  1124.  
  1125. ButtonOuter.Size = UDim2.new(0.5, -2, 0, 20)
  1126.  
  1127. local Outer = ButtonOuter:Clone()
  1128. local Inner = Outer.Frame;
  1129. local Label = Inner:FindFirstChildWhichIsA('TextLabel')
  1130.  
  1131. Outer.Position = UDim2.new(1, 2, 0, 0)
  1132. Outer.Size = UDim2.fromOffset(ButtonOuter.AbsoluteSize.X - 2, ButtonOuter.AbsoluteSize.Y)
  1133. Outer.Parent = ButtonOuter
  1134.  
  1135. Label.Text = Text;
  1136.  
  1137. Library:AddToRegistry(Inner, {
  1138. BackgroundColor3 = 'MainColor';
  1139. BorderColor3 = 'OutlineColor';
  1140. });
  1141.  
  1142. Library:OnHighlight(Outer, Outer,
  1143. { BorderColor3 = 'AccentColor' },
  1144. { BorderColor3 = 'Black' }
  1145. )
  1146.  
  1147. Library:Create('UIGradient', {
  1148. Color = ColorSequence.new({
  1149. ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1150. ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1151. });
  1152.  
  1153. Rotation = 90;
  1154. Parent = Inner;
  1155. });
  1156.  
  1157. Outer.InputBegan:Connect(function(Input)
  1158. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  1159. Func();
  1160. end;
  1161. end);
  1162.  
  1163. function SubButton:AddTooltip(tip)
  1164. if type(tip) == 'string' then
  1165. Library:AddToolTip(tip, Outer)
  1166. end
  1167. return SubButton
  1168. end
  1169.  
  1170. return SubButton
  1171. end
  1172.  
  1173. Groupbox:AddBlank(5);
  1174. Groupbox:Resize();
  1175.  
  1176. return Button;
  1177. end;
  1178.  
  1179. function Funcs:AddDivider()
  1180. local Groupbox = self;
  1181. local Container = self.Container
  1182.  
  1183. local Divider = {
  1184. Type = 'Divider',
  1185. }
  1186.  
  1187. Groupbox:AddBlank(2);
  1188. local DividerOuter = Library:Create('Frame', {
  1189. BorderColor3 = Color3.new(0, 0, 0);
  1190. Size = UDim2.new(1, -4, 0, 5);
  1191. ZIndex = 5;
  1192. Parent = Container;
  1193. });
  1194.  
  1195. local DividerInner = Library:Create('Frame', {
  1196. BackgroundColor3 = Library.MainColor;
  1197. BorderColor3 = Library.OutlineColor;
  1198. BorderMode = Enum.BorderMode.Inset;
  1199. Size = UDim2.new(1, 0, 1, 0);
  1200. ZIndex = 6;
  1201. Parent = DividerOuter;
  1202. });
  1203.  
  1204. Library:AddToRegistry(DividerOuter, {
  1205. BorderColor3 = 'Black';
  1206. });
  1207.  
  1208. Library:AddToRegistry(DividerInner, {
  1209. BackgroundColor3 = 'MainColor';
  1210. BorderColor3 = 'OutlineColor';
  1211. });
  1212.  
  1213. Groupbox:AddBlank(9);
  1214. Groupbox:Resize();
  1215. end
  1216.  
  1217. function Funcs:AddInput(Idx, Info)
  1218. local Textbox = {
  1219. Value = Info.Default or '';
  1220. Numeric = Info.Numeric or false;
  1221. Finished = Info.Finished or false;
  1222. Type = 'Input';
  1223. };
  1224.  
  1225. local Groupbox = self;
  1226. local Container = Groupbox.Container;
  1227.  
  1228. local InputLabel = Library:CreateLabel({
  1229. Size = UDim2.new(1, 0, 0, 15);
  1230. TextSize = 14;
  1231. Text = Info.Text;
  1232. TextXAlignment = Enum.TextXAlignment.Left;
  1233. ZIndex = 5;
  1234. Parent = Container;
  1235. });
  1236.  
  1237. Groupbox:AddBlank(1);
  1238.  
  1239. local TextBoxOuter = Library:Create('Frame', {
  1240. BorderColor3 = Color3.new(0, 0, 0);
  1241. Size = UDim2.new(1, -4, 0, 20);
  1242. ZIndex = 5;
  1243. Parent = Container;
  1244. });
  1245.  
  1246. local TextBoxInner = Library:Create('Frame', {
  1247. BackgroundColor3 = Library.MainColor;
  1248. BorderColor3 = Library.OutlineColor;
  1249. BorderMode = Enum.BorderMode.Inset;
  1250. Size = UDim2.new(1, 0, 1, 0);
  1251. ZIndex = 6;
  1252. Parent = TextBoxOuter;
  1253. });
  1254.  
  1255. Library:AddToRegistry(TextBoxInner, {
  1256. BackgroundColor3 = 'MainColor';
  1257. BorderColor3 = 'OutlineColor';
  1258. });
  1259.  
  1260. Library:OnHighlight(TextBoxOuter, TextBoxOuter,
  1261. { BorderColor3 = 'AccentColor' },
  1262. { BorderColor3 = 'Black' }
  1263. );
  1264.  
  1265. if type(Info.Tooltip) == 'string' then
  1266. Library:AddToolTip(Info.Tooltip, TextBoxOuter)
  1267. end
  1268.  
  1269. Library:Create('UIGradient', {
  1270. Color = ColorSequence.new({
  1271. ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1272. ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1273. });
  1274. Rotation = 90;
  1275. Parent = TextBoxInner;
  1276. });
  1277.  
  1278. local Container = Library:Create('Frame', {
  1279. BackgroundTransparency = 1;
  1280. ClipsDescendants = true;
  1281.  
  1282. Position = UDim2.new(0, 5, 0, 0);
  1283. Size = UDim2.new(1, -5, 1, 0);
  1284.  
  1285. ZIndex = 7;
  1286. Parent = TextBoxInner;
  1287. })
  1288.  
  1289. local Box = Library:Create('TextBox', {
  1290. BackgroundTransparency = 1;
  1291.  
  1292. Position = UDim2.fromOffset(0, 0),
  1293. Size = UDim2.fromScale(5, 1),
  1294.  
  1295. Font = Enum.Font.Code;
  1296. PlaceholderColor3 = Color3.fromRGB(190, 190, 190);
  1297. PlaceholderText = Info.Placeholder or '';
  1298.  
  1299. Text = Info.Default or '';
  1300. TextColor3 = Library.FontColor;
  1301. TextSize = 14;
  1302. TextStrokeTransparency = 0;
  1303. TextXAlignment = Enum.TextXAlignment.Left;
  1304.  
  1305. ZIndex = 7;
  1306. Parent = Container;
  1307. });
  1308.  
  1309. function Textbox:SetValue(Text)
  1310. if Info.MaxLength and #Text > Info.MaxLength then
  1311. Text = Text:sub(1, Info.MaxLength);
  1312. end;
  1313.  
  1314. if Textbox.Numeric then
  1315. if (not tonumber(Text)) and Text:len() > 0 then
  1316. Text = Textbox.Value
  1317. end
  1318. end
  1319.  
  1320. Textbox.Value = Text;
  1321. Box.Text = Text;
  1322.  
  1323. if Textbox.Changed then
  1324. Textbox.Changed();
  1325. end;
  1326. end;
  1327.  
  1328. if Textbox.Finished then
  1329. Box.FocusLost:Connect(function(enter)
  1330. if not enter then return end
  1331.  
  1332. Textbox:SetValue(Box.Text);
  1333. Library:AttemptSave();
  1334. end)
  1335. else
  1336. Box:GetPropertyChangedSignal('Text'):Connect(function()
  1337. Textbox:SetValue(Box.Text);
  1338. Library:AttemptSave();
  1339. end);
  1340. end
  1341.  
  1342. -- https://devforum.roblox.com/t/how-to-make-textboxes-follow-current-cursor-position/1368429/6
  1343. -- thank you nicemike40 :)
  1344.  
  1345. local function Update()
  1346. local PADDING = 5
  1347. local reveal = Container.AbsoluteSize.X
  1348.  
  1349. if not Box:IsFocused() or Box.TextBounds.X <= reveal - 2 * PADDING then
  1350. -- we aren't focused, or we fit so be normal
  1351. Box.Position = UDim2.new(0, PADDING, 0, 0)
  1352. else
  1353. -- we are focused and don't fit, so adjust position
  1354. local cursor = Box.CursorPosition
  1355. if cursor ~= -1 then
  1356. -- calculate pixel width of text from start to cursor
  1357. local subtext = string.sub(Box.Text, 1, cursor-1)
  1358. local width = TextService:GetTextSize(subtext, Box.TextSize, Box.Font, Vector2.new(math.huge, math.huge)).X
  1359.  
  1360. -- check if we're inside the box with the cursor
  1361. local currentCursorPos = Box.Position.X.Offset + width
  1362.  
  1363. -- adjust if necessary
  1364. if currentCursorPos < PADDING then
  1365. Box.Position = UDim2.fromOffset(PADDING-width, 0)
  1366. elseif currentCursorPos > reveal - PADDING - 1 then
  1367. Box.Position = UDim2.fromOffset(reveal-width-PADDING-1, 0)
  1368. end
  1369. end
  1370. end
  1371. end
  1372.  
  1373. task.spawn(Update)
  1374.  
  1375. Box:GetPropertyChangedSignal('Text'):Connect(Update)
  1376. Box:GetPropertyChangedSignal('CursorPosition'):Connect(Update)
  1377. Box.FocusLost:Connect(Update)
  1378. Box.Focused:Connect(Update)
  1379.  
  1380. Library:AddToRegistry(Box, {
  1381. TextColor3 = 'FontColor';
  1382. });
  1383.  
  1384. function Textbox:OnChanged(Func)
  1385. Textbox.Changed = Func;
  1386. Func();
  1387. end;
  1388.  
  1389. Groupbox:AddBlank(5);
  1390. Groupbox:Resize();
  1391.  
  1392. Options[Idx] = Textbox;
  1393.  
  1394. return Textbox;
  1395. end;
  1396.  
  1397. function Funcs:AddToggle(Idx, Info)
  1398. local Toggle = {
  1399. Value = Info.Default or false;
  1400. Type = 'Toggle';
  1401.  
  1402. Addons = {},
  1403. };
  1404.  
  1405. local Groupbox = self;
  1406. local Container = Groupbox.Container;
  1407.  
  1408. local ToggleOuter = Library:Create('Frame', {
  1409. BorderColor3 = Color3.new(0, 0, 0);
  1410. Size = UDim2.new(0, 13, 0, 13);
  1411. ZIndex = 5;
  1412. Parent = Container;
  1413. });
  1414.  
  1415. Library:AddToRegistry(ToggleOuter, {
  1416. BorderColor3 = 'Black';
  1417. });
  1418.  
  1419. local ToggleInner = Library:Create('Frame', {
  1420. BackgroundColor3 = Library.MainColor;
  1421. BorderColor3 = Library.OutlineColor;
  1422. BorderMode = Enum.BorderMode.Inset;
  1423. Size = UDim2.new(1, 0, 1, 0);
  1424. ZIndex = 6;
  1425. Parent = ToggleOuter;
  1426. });
  1427.  
  1428. Library:AddToRegistry(ToggleInner, {
  1429. BackgroundColor3 = 'MainColor';
  1430. BorderColor3 = 'OutlineColor';
  1431. });
  1432.  
  1433. local ToggleLabel = Library:CreateLabel({
  1434. Size = UDim2.new(0, 216, 1, 0);
  1435. Position = UDim2.new(1, 6, 0, 0);
  1436. TextSize = 14;
  1437. Text = Info.Text;
  1438. TextXAlignment = Enum.TextXAlignment.Left;
  1439. ZIndex = 6;
  1440. Parent = ToggleInner;
  1441. });
  1442.  
  1443. Library:Create('UIListLayout', {
  1444. Padding = UDim.new(0, 4);
  1445. FillDirection = Enum.FillDirection.Horizontal;
  1446. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  1447. SortOrder = Enum.SortOrder.LayoutOrder;
  1448. Parent = ToggleLabel;
  1449. });
  1450.  
  1451. local ToggleRegion = Library:Create('Frame', {
  1452. BackgroundTransparency = 1;
  1453. Size = UDim2.new(0, 170, 1, 0);
  1454. ZIndex = 8;
  1455. Parent = ToggleOuter;
  1456. });
  1457.  
  1458. Library:OnHighlight(ToggleRegion, ToggleOuter,
  1459. { BorderColor3 = 'AccentColor' },
  1460. { BorderColor3 = 'Black' }
  1461. );
  1462.  
  1463. function Toggle:UpdateColors()
  1464. Toggle:Display();
  1465. end;
  1466.  
  1467. if type(Info.Tooltip) == 'string' then
  1468. Library:AddToolTip(Info.Tooltip, ToggleRegion)
  1469. end
  1470.  
  1471. function Toggle:Display()
  1472. ToggleInner.BackgroundColor3 = Toggle.Value and Library.AccentColor or Library.MainColor;
  1473. ToggleInner.BorderColor3 = Toggle.Value and Library.AccentColorDark or Library.OutlineColor;
  1474.  
  1475. Library.RegistryMap[ToggleInner].Properties.BackgroundColor3 = Toggle.Value and 'AccentColor' or 'MainColor';
  1476. Library.RegistryMap[ToggleInner].Properties.BorderColor3 = Toggle.Value and 'AccentColorDark' or 'OutlineColor';
  1477. end;
  1478.  
  1479. function Toggle:OnChanged(Func)
  1480. Toggle.Changed = Func;
  1481. Func();
  1482. end;
  1483.  
  1484. function Toggle:SetValue(Bool)
  1485. Bool = (not not Bool);
  1486.  
  1487. Toggle.Value = Bool;
  1488. Toggle:Display();
  1489.  
  1490. for _, Addon in next, Toggle.Addons do
  1491. if Addon.Type == 'KeyPicker' and Addon.SyncToggleState then
  1492. Addon.Toggled = Bool
  1493. Addon:Update()
  1494. end
  1495. end
  1496.  
  1497. if Toggle.Changed then
  1498. Toggle.Changed();
  1499. end;
  1500. end;
  1501.  
  1502. ToggleRegion.InputBegan:Connect(function(Input)
  1503. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  1504. Toggle:SetValue(not Toggle.Value) -- Why was it not like this from the start?
  1505. Library:AttemptSave();
  1506. end;
  1507. end);
  1508.  
  1509. Toggle:Display();
  1510. Groupbox:AddBlank(Info.BlankSize or 5 + 2);
  1511. Groupbox:Resize();
  1512.  
  1513. Toggle.TextLabel = ToggleLabel;
  1514. Toggle.Container = Container;
  1515. setmetatable(Toggle, BaseAddons);
  1516.  
  1517. Toggles[Idx] = Toggle;
  1518.  
  1519. return Toggle;
  1520. end;
  1521.  
  1522. function Funcs:AddSlider(Idx, Info)
  1523. assert(Info.Default and Info.Text and Info.Min and Info.Max and Info.Rounding, 'Bad Slider Data');
  1524.  
  1525. local Slider = {
  1526. Value = Info.Default;
  1527. Min = Info.Min;
  1528. Max = Info.Max;
  1529. Rounding = Info.Rounding;
  1530. MaxSize = 232;
  1531. Type = 'Slider';
  1532. };
  1533.  
  1534. local Groupbox = self;
  1535. local Container = Groupbox.Container;
  1536.  
  1537. if not Info.Compact then
  1538. Library:CreateLabel({
  1539. Size = UDim2.new(1, 0, 0, 10);
  1540. TextSize = 14;
  1541. Text = Info.Text;
  1542. TextXAlignment = Enum.TextXAlignment.Left;
  1543. TextYAlignment = Enum.TextYAlignment.Bottom;
  1544. ZIndex = 5;
  1545. Parent = Container;
  1546. });
  1547.  
  1548. Groupbox:AddBlank(3);
  1549. end
  1550.  
  1551. local SliderOuter = Library:Create('Frame', {
  1552. BorderColor3 = Color3.new(0, 0, 0);
  1553. Size = UDim2.new(1, -4, 0, 13);
  1554. ZIndex = 5;
  1555. Parent = Container;
  1556. });
  1557.  
  1558. Library:AddToRegistry(SliderOuter, {
  1559. BorderColor3 = 'Black';
  1560. });
  1561.  
  1562. local SliderInner = Library:Create('Frame', {
  1563. BackgroundColor3 = Library.MainColor;
  1564. BorderColor3 = Library.OutlineColor;
  1565. BorderMode = Enum.BorderMode.Inset;
  1566. Size = UDim2.new(1, 0, 1, 0);
  1567. ZIndex = 6;
  1568. Parent = SliderOuter;
  1569. });
  1570.  
  1571. Library:AddToRegistry(SliderInner, {
  1572. BackgroundColor3 = 'MainColor';
  1573. BorderColor3 = 'OutlineColor';
  1574. });
  1575.  
  1576. local Fill = Library:Create('Frame', {
  1577. BackgroundColor3 = Library.AccentColor;
  1578. BorderColor3 = Library.AccentColorDark;
  1579. Size = UDim2.new(0, 0, 1, 0);
  1580. ZIndex = 7;
  1581. Parent = SliderInner;
  1582. });
  1583.  
  1584. Library:AddToRegistry(Fill, {
  1585. BackgroundColor3 = 'AccentColor';
  1586. BorderColor3 = 'AccentColorDark';
  1587. });
  1588.  
  1589. local HideBorderRight = Library:Create('Frame', {
  1590. BackgroundColor3 = Library.AccentColor;
  1591. BorderSizePixel = 0;
  1592. Position = UDim2.new(1, 0, 0, 0);
  1593. Size = UDim2.new(0, 1, 1, 0);
  1594. ZIndex = 8;
  1595. Parent = Fill;
  1596. });
  1597.  
  1598. Library:AddToRegistry(HideBorderRight, {
  1599. BackgroundColor3 = 'AccentColor';
  1600. });
  1601.  
  1602. local DisplayLabel = Library:CreateLabel({
  1603. Size = UDim2.new(1, 0, 1, 0);
  1604. TextSize = 14;
  1605. Text = 'Infinite';
  1606. ZIndex = 9;
  1607. Parent = SliderInner;
  1608. });
  1609.  
  1610. Library:OnHighlight(SliderOuter, SliderOuter,
  1611. { BorderColor3 = 'AccentColor' },
  1612. { BorderColor3 = 'Black' }
  1613. );
  1614.  
  1615. if type(Info.Tooltip) == 'string' then
  1616. Library:AddToolTip(Info.Tooltip, SliderOuter)
  1617. end
  1618.  
  1619. function Slider:UpdateColors()
  1620. Fill.BackgroundColor3 = Library.AccentColor;
  1621. Fill.BorderColor3 = Library.AccentColorDark;
  1622. end;
  1623.  
  1624. function Slider:Display()
  1625. local Suffix = Info.Suffix or '';
  1626. DisplayLabel.Text = string.format('%s/%s', Slider.Value .. Suffix, Slider.Max .. Suffix);
  1627.  
  1628. local X = math.ceil(Library:MapValue(Slider.Value, Slider.Min, Slider.Max, 0, Slider.MaxSize));
  1629. Fill.Size = UDim2.new(0, X, 1, 0);
  1630.  
  1631. HideBorderRight.Visible = not (X == Slider.MaxSize or X == 0);
  1632. end;
  1633.  
  1634. function Slider:OnChanged(Func)
  1635. Slider.Changed = Func;
  1636. Func();
  1637. end;
  1638.  
  1639. local function Round(Value)
  1640. if Slider.Rounding == 0 then
  1641. return math.floor(Value);
  1642. end;
  1643.  
  1644. local Str = Value .. '';
  1645. local Dot = Str:find('%.');
  1646.  
  1647. return Dot and tonumber(Str:sub(1, Dot + Slider.Rounding)) or Value;
  1648. end;
  1649.  
  1650. function Slider:GetValueFromXOffset(X)
  1651. return Round(Library:MapValue(X, 0, Slider.MaxSize, Slider.Min, Slider.Max));
  1652. end;
  1653.  
  1654. function Slider:SetValue(Str)
  1655. local Num = tonumber(Str);
  1656.  
  1657. if (not Num) then
  1658. return;
  1659. end;
  1660.  
  1661. Num = math.clamp(Num, Slider.Min, Slider.Max);
  1662.  
  1663. Slider.Value = Num;
  1664. Slider:Display();
  1665.  
  1666. if Slider.Changed then
  1667. Slider.Changed();
  1668. end;
  1669. end;
  1670.  
  1671. SliderInner.InputBegan:Connect(function(Input)
  1672. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  1673. local mPos = Mouse.X;
  1674. local gPos = Fill.Size.X.Offset;
  1675. local Diff = mPos - (Fill.AbsolutePosition.X + gPos);
  1676.  
  1677. while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  1678. local nMPos = Mouse.X;
  1679. local nX = math.clamp(gPos + (nMPos - mPos) + Diff, 0, Slider.MaxSize);
  1680.  
  1681. local nValue = Slider:GetValueFromXOffset(nX);
  1682. local OldValue = Slider.Value;
  1683. Slider.Value = nValue;
  1684.  
  1685. Slider:Display();
  1686.  
  1687. if nValue ~= OldValue and Slider.Changed then
  1688. Slider.Changed();
  1689. end;
  1690.  
  1691. RenderStepped:Wait();
  1692. end;
  1693.  
  1694. Library:AttemptSave();
  1695. end;
  1696. end);
  1697.  
  1698. Slider:Display();
  1699. Groupbox:AddBlank(Info.BlankSize or 6);
  1700. Groupbox:Resize();
  1701.  
  1702. Options[Idx] = Slider;
  1703.  
  1704. return Slider;
  1705. end;
  1706.  
  1707. function Funcs:AddDropdown(Idx, Info)
  1708. assert(Info.Text and Info.Values, 'Bad Dropdown Data');
  1709.  
  1710. local Dropdown = {
  1711. Values = Info.Values;
  1712. Value = Info.Multi and {};
  1713. Multi = Info.Multi;
  1714. Type = 'Dropdown';
  1715. };
  1716.  
  1717. local Groupbox = self;
  1718. local Container = Groupbox.Container;
  1719.  
  1720. local RelativeOffset = 0;
  1721.  
  1722. local DropdownLabel = Library:CreateLabel({
  1723. Size = UDim2.new(1, 0, 0, 10);
  1724. TextSize = 14;
  1725. Text = Info.Text;
  1726. TextXAlignment = Enum.TextXAlignment.Left;
  1727. TextYAlignment = Enum.TextYAlignment.Bottom;
  1728. ZIndex = 5;
  1729. Parent = Container;
  1730. });
  1731.  
  1732. Groupbox:AddBlank(3);
  1733.  
  1734. for _, Element in next, Container:GetChildren() do
  1735. if not Element:IsA('UIListLayout') then
  1736. RelativeOffset = RelativeOffset + Element.Size.Y.Offset;
  1737. end;
  1738. end;
  1739.  
  1740. local DropdownOuter = Library:Create('Frame', {
  1741. BorderColor3 = Color3.new(0, 0, 0);
  1742. Size = UDim2.new(1, -4, 0, 20);
  1743. ZIndex = 5;
  1744. Parent = Container;
  1745. });
  1746.  
  1747. Library:AddToRegistry(DropdownOuter, {
  1748. BorderColor3 = 'Black';
  1749. });
  1750.  
  1751. local DropdownInner = Library:Create('Frame', {
  1752. BackgroundColor3 = Library.MainColor;
  1753. BorderColor3 = Library.OutlineColor;
  1754. BorderMode = Enum.BorderMode.Inset;
  1755. Size = UDim2.new(1, 0, 1, 0);
  1756. ZIndex = 6;
  1757. Parent = DropdownOuter;
  1758. });
  1759.  
  1760. Library:AddToRegistry(DropdownInner, {
  1761. BackgroundColor3 = 'MainColor';
  1762. BorderColor3 = 'OutlineColor';
  1763. });
  1764.  
  1765. Library:Create('UIGradient', {
  1766. Color = ColorSequence.new({
  1767. ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1768. ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1769. });
  1770. Rotation = 90;
  1771. Parent = DropdownInner;
  1772. });
  1773.  
  1774. local DropdownArrow = Library:Create('ImageLabel', {
  1775. AnchorPoint = Vector2.new(0, 0.5);
  1776. BackgroundTransparency = 1;
  1777. Position = UDim2.new(1, -16, 0.5, 0);
  1778. Size = UDim2.new(0, 12, 0, 12);
  1779. Image = 'http://www.roblox.com/asset/?id=6282522798';
  1780. ZIndex = 7;
  1781. Parent = DropdownInner;
  1782. });
  1783.  
  1784. local ItemList = Library:CreateLabel({
  1785. Position = UDim2.new(0, 5, 0, 0);
  1786. Size = UDim2.new(1, -5, 1, 0);
  1787. TextSize = 14;
  1788. Text = '--';
  1789. TextXAlignment = Enum.TextXAlignment.Left;
  1790. TextWrapped = true;
  1791. ZIndex = 7;
  1792. Parent = DropdownInner;
  1793. });
  1794.  
  1795. Library:OnHighlight(DropdownOuter, DropdownOuter,
  1796. { BorderColor3 = 'AccentColor' },
  1797. { BorderColor3 = 'Black' }
  1798. );
  1799.  
  1800. if type(Info.Tooltip) == 'string' then
  1801. Library:AddToolTip(Info.Tooltip, DropdownOuter)
  1802. end
  1803.  
  1804. local MAX_DROPDOWN_ITEMS = 8;
  1805.  
  1806. local ListOuter = Library:Create('Frame', {
  1807. BorderColor3 = Color3.new(0, 0, 0);
  1808. Position = UDim2.new(0, 4, 0, 20 + RelativeOffset + 1 + 20);
  1809. Size = UDim2.new(1, -8, 0, MAX_DROPDOWN_ITEMS * 20 + 2);
  1810. ZIndex = 20;
  1811. Visible = false;
  1812. Parent = Container.Parent;
  1813. });
  1814.  
  1815. local ListInner = Library:Create('Frame', {
  1816. BackgroundColor3 = Library.MainColor;
  1817. BorderColor3 = Library.OutlineColor;
  1818. BorderMode = Enum.BorderMode.Inset;
  1819. BorderSizePixel = 0;
  1820. Size = UDim2.new(1, 0, 1, 0);
  1821. ZIndex = 21;
  1822. Parent = ListOuter;
  1823. });
  1824.  
  1825. Library:AddToRegistry(ListInner, {
  1826. BackgroundColor3 = 'MainColor';
  1827. BorderColor3 = 'OutlineColor';
  1828. });
  1829.  
  1830. local Scrolling = Library:Create('ScrollingFrame', {
  1831. BackgroundTransparency = 1;
  1832. CanvasSize = UDim2.new(0, 0, 0, 0);
  1833. Size = UDim2.new(1, 0, 1, 0);
  1834. ZIndex = 21;
  1835. Parent = ListInner;
  1836.  
  1837. TopImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
  1838. BottomImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
  1839.  
  1840. ScrollBarThickness = 3,
  1841. ScrollBarImageColor3 = Library.AccentColor,
  1842. });
  1843.  
  1844. Library:AddToRegistry(Scrolling, {
  1845. ScrollBarImageColor3 = 'AccentColor'
  1846. })
  1847.  
  1848. Library:Create('UIListLayout', {
  1849. Padding = UDim.new(0, 0);
  1850. FillDirection = Enum.FillDirection.Vertical;
  1851. SortOrder = Enum.SortOrder.LayoutOrder;
  1852. Parent = Scrolling;
  1853. });
  1854.  
  1855. function Dropdown:Display()
  1856. local Values = Dropdown.Values;
  1857. local Str = '';
  1858.  
  1859. if Info.Multi then
  1860. for Idx, Value in next, Values do
  1861. if Dropdown.Value[Value] then
  1862. Str = Str .. Value .. ', ';
  1863. end;
  1864. end;
  1865.  
  1866. Str = Str:sub(1, #Str - 2);
  1867. else
  1868. Str = Dropdown.Value or '';
  1869. end;
  1870.  
  1871. ItemList.Text = (Str == '' and '--' or Str);
  1872. end;
  1873.  
  1874. function Dropdown:GetActiveValues()
  1875. if Info.Multi then
  1876. local T = {};
  1877.  
  1878. for Value, Bool in next, Dropdown.Value do
  1879. table.insert(T, Value);
  1880. end;
  1881.  
  1882. return T;
  1883. else
  1884. return Dropdown.Value and 1 or 0;
  1885. end;
  1886. end;
  1887.  
  1888. function Dropdown:SetValues()
  1889. local Values = Dropdown.Values;
  1890. local Buttons = {};
  1891.  
  1892. for _, Element in next, Scrolling:GetChildren() do
  1893. if not Element:IsA('UIListLayout') then
  1894. -- Library:RemoveFromRegistry(Element);
  1895. Element:Destroy();
  1896. end;
  1897. end;
  1898.  
  1899. local Count = 0;
  1900.  
  1901. for Idx, Value in next, Values do
  1902. local Table = {};
  1903.  
  1904. Count = Count + 1;
  1905.  
  1906. local Button = Library:Create('Frame', {
  1907. BackgroundColor3 = Library.MainColor;
  1908. BorderColor3 = Library.OutlineColor;
  1909. BorderMode = Enum.BorderMode.Middle;
  1910. Size = UDim2.new(1, -1, 0, 20);
  1911. ZIndex = 23;
  1912. Active = true,
  1913. Parent = Scrolling;
  1914. });
  1915.  
  1916. Library:AddToRegistry(Button, {
  1917. BackgroundColor3 = 'MainColor';
  1918. BorderColor3 = 'OutlineColor';
  1919. });
  1920.  
  1921. local ButtonLabel = Library:CreateLabel({
  1922. Size = UDim2.new(1, -6, 1, 0);
  1923. Position = UDim2.new(0, 6, 0, 0);
  1924. TextSize = 14;
  1925. Text = Value;
  1926. TextXAlignment = Enum.TextXAlignment.Left;
  1927. ZIndex = 25;
  1928. Parent = Button;
  1929. });
  1930.  
  1931. Library:OnHighlight(Button, Button,
  1932. { BorderColor3 = 'AccentColor', ZIndex = 24 },
  1933. { BorderColor3 = 'OutlineColor', ZIndex = 23 }
  1934. );
  1935.  
  1936. local Selected;
  1937.  
  1938. if Info.Multi then
  1939. Selected = Dropdown.Value[Value];
  1940. else
  1941. Selected = Dropdown.Value == Value;
  1942. end;
  1943.  
  1944. function Table:UpdateButton()
  1945. if Info.Multi then
  1946. Selected = Dropdown.Value[Value];
  1947. else
  1948. Selected = Dropdown.Value == Value;
  1949. end;
  1950.  
  1951. ButtonLabel.TextColor3 = Selected and Library.AccentColor or Library.FontColor;
  1952. Library.RegistryMap[ButtonLabel].Properties.TextColor3 = Selected and 'AccentColor' or 'FontColor';
  1953. end;
  1954.  
  1955. ButtonLabel.InputBegan:Connect(function(Input)
  1956. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1957. local Try = not Selected;
  1958.  
  1959. if Dropdown:GetActiveValues() == 1 and (not Try) and (not Info.AllowNull) then
  1960. else
  1961. if Info.Multi then
  1962. Selected = Try;
  1963.  
  1964. if Selected then
  1965. Dropdown.Value[Value] = true;
  1966. else
  1967. Dropdown.Value[Value] = nil;
  1968. end;
  1969. else
  1970. Selected = Try;
  1971.  
  1972. if Selected then
  1973. Dropdown.Value = Value;
  1974. else
  1975. Dropdown.Value = nil;
  1976. end;
  1977.  
  1978. for _, OtherButton in next, Buttons do
  1979. OtherButton:UpdateButton();
  1980. end;
  1981. end;
  1982.  
  1983. Table:UpdateButton();
  1984. Dropdown:Display();
  1985.  
  1986. if Dropdown.Changed then
  1987. Dropdown.Changed();
  1988. end;
  1989.  
  1990. Library:AttemptSave();
  1991. end;
  1992. end;
  1993. end);
  1994.  
  1995. Table:UpdateButton();
  1996. Dropdown:Display();
  1997.  
  1998. Buttons[Button] = Table;
  1999. end;
  2000.  
  2001. local Y = math.clamp(Count * 20, 0, MAX_DROPDOWN_ITEMS * 20) + 1;
  2002. ListOuter.Size = UDim2.new(1, -8, 0, Y);
  2003. Scrolling.CanvasSize = UDim2.new(0, 0, 0, (Count * 20) + 1);
  2004.  
  2005. -- ListOuter.Size = UDim2.new(1, -8, 0, (#Values * 20) + 2);
  2006. end;
  2007.  
  2008. function Dropdown:OpenDropdown()
  2009. ListOuter.Visible = true;
  2010. Library.OpenedFrames[ListOuter] = true;
  2011. DropdownArrow.Rotation = 180;
  2012. end;
  2013.  
  2014. function Dropdown:CloseDropdown()
  2015. ListOuter.Visible = false;
  2016. Library.OpenedFrames[ListOuter] = nil;
  2017. DropdownArrow.Rotation = 0;
  2018. end;
  2019.  
  2020. function Dropdown:OnChanged(Func)
  2021. Dropdown.Changed = Func;
  2022. Func();
  2023. end;
  2024.  
  2025. function Dropdown:SetValue(Val)
  2026. if Dropdown.Multi then
  2027. local nTable = {};
  2028.  
  2029. for Value, Bool in next, Val do
  2030. if table.find(Dropdown.Values, Value) then
  2031. nTable[Value] = true
  2032. end;
  2033. end;
  2034.  
  2035. Dropdown.Value = nTable;
  2036. else
  2037. if (not Val) then
  2038. Dropdown.Value = nil;
  2039. elseif table.find(Dropdown.Values, Val) then
  2040. Dropdown.Value = Val;
  2041. end;
  2042. end;
  2043.  
  2044. Dropdown:SetValues();
  2045. Dropdown:Display();
  2046.  
  2047. if Dropdown.Changed then Dropdown.Changed() end
  2048. end;
  2049.  
  2050. DropdownOuter.InputBegan:Connect(function(Input)
  2051. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  2052. if ListOuter.Visible then
  2053. Dropdown:CloseDropdown();
  2054. else
  2055. Dropdown:OpenDropdown();
  2056. end;
  2057. end;
  2058. end);
  2059.  
  2060. InputService.InputBegan:Connect(function(Input)
  2061. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  2062. local AbsPos, AbsSize = ListOuter.AbsolutePosition, ListOuter.AbsoluteSize;
  2063.  
  2064. if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  2065. or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  2066.  
  2067. Dropdown:CloseDropdown();
  2068. end;
  2069. end;
  2070. end);
  2071.  
  2072. Dropdown:SetValues();
  2073. Dropdown:Display();
  2074.  
  2075. if type(Info.Default) == 'string' then
  2076. Info.Default = table.find(Dropdown.Values, Info.Default)
  2077. end
  2078.  
  2079. if Info.Default then
  2080. if Info.Multi then
  2081. Dropdown.Value[Dropdown.Values[Info.Default]] = true;
  2082. else
  2083. Dropdown.Value = Dropdown.Values[Info.Default];
  2084. end;
  2085.  
  2086. Dropdown:SetValues();
  2087. Dropdown:Display();
  2088. end;
  2089.  
  2090. Groupbox:AddBlank(Info.BlankSize or 5);
  2091. Groupbox:Resize();
  2092.  
  2093. Options[Idx] = Dropdown;
  2094.  
  2095. return Dropdown;
  2096. end;
  2097.  
  2098. BaseGroupbox.__index = Funcs;
  2099. BaseGroupbox.__namecall = function(Table, Key, ...)
  2100. return Funcs[Key](...);
  2101. end;
  2102. end;
  2103.  
  2104. -- < Create other UI elements >
  2105. do
  2106. Library.NotificationArea = Library:Create('Frame', {
  2107. BackgroundTransparency = 1;
  2108. Position = UDim2.new(0, 0, 0, 40);
  2109. Size = UDim2.new(0, 300, 0, 200);
  2110. ZIndex = 100;
  2111. Parent = ScreenGui;
  2112. });
  2113.  
  2114. Library:Create('UIListLayout', {
  2115. Padding = UDim.new(0, 4);
  2116. FillDirection = Enum.FillDirection.Vertical;
  2117. SortOrder = Enum.SortOrder.LayoutOrder;
  2118. Parent = Library.NotificationArea;
  2119. });
  2120.  
  2121. local WatermarkOuter = Library:Create('Frame', {
  2122. BorderColor3 = Color3.new(0, 0, 0);
  2123. Position = UDim2.new(0, 100, 0, -25);
  2124. Size = UDim2.new(0, 213, 0, 20);
  2125. ZIndex = 200;
  2126. Visible = false;
  2127. Parent = ScreenGui;
  2128. });
  2129.  
  2130. local WatermarkInner = Library:Create('Frame', {
  2131. BackgroundColor3 = Library.MainColor;
  2132. BorderColor3 = Library.AccentColor;
  2133. BorderMode = Enum.BorderMode.Inset;
  2134. Size = UDim2.new(1, 0, 1, 0);
  2135. ZIndex = 201;
  2136. Parent = WatermarkOuter;
  2137. });
  2138.  
  2139. Library:AddToRegistry(WatermarkInner, {
  2140. BorderColor3 = 'AccentColor';
  2141. });
  2142.  
  2143. local InnerFrame = Library:Create('Frame', {
  2144. BackgroundColor3 = Color3.new(1, 1, 1);
  2145. BorderSizePixel = 0;
  2146. Position = UDim2.new(0, 1, 0, 1);
  2147. Size = UDim2.new(1, -2, 1, -2);
  2148. ZIndex = 202;
  2149. Parent = WatermarkInner;
  2150. });
  2151.  
  2152. local Gradient = Library:Create('UIGradient', {
  2153. Color = ColorSequence.new({
  2154. ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  2155. ColorSequenceKeypoint.new(1, Library.MainColor),
  2156. });
  2157. Rotation = -90;
  2158. Parent = InnerFrame;
  2159. });
  2160.  
  2161. Library:AddToRegistry(Gradient, {
  2162. Color = function()
  2163. return ColorSequence.new({
  2164. ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  2165. ColorSequenceKeypoint.new(1, Library.MainColor),
  2166. });
  2167. end
  2168. });
  2169.  
  2170. local WatermarkLabel = Library:CreateLabel({
  2171. Position = UDim2.new(0, 5, 0, 0);
  2172. Size = UDim2.new(1, -4, 1, 0);
  2173. TextSize = 14;
  2174. TextXAlignment = Enum.TextXAlignment.Left;
  2175. ZIndex = 203;
  2176. Parent = InnerFrame;
  2177. });
  2178.  
  2179. Library.Watermark = WatermarkOuter;
  2180. Library.WatermarkText = WatermarkLabel;
  2181. Library:MakeDraggable(Library.Watermark);
  2182.  
  2183.  
  2184.  
  2185. local KeybindOuter = Library:Create('Frame', {
  2186. AnchorPoint = Vector2.new(0, 0.5);
  2187. BorderColor3 = Color3.new(0, 0, 0);
  2188. Position = UDim2.new(0, 10, 0.5, 0);
  2189. Size = UDim2.new(0, 210, 0, 20);
  2190. Visible = false;
  2191. ZIndex = 100;
  2192. Parent = ScreenGui;
  2193. });
  2194.  
  2195. local KeybindInner = Library:Create('Frame', {
  2196. BackgroundColor3 = Library.MainColor;
  2197. BorderColor3 = Library.OutlineColor;
  2198. BorderMode = Enum.BorderMode.Inset;
  2199. Size = UDim2.new(1, 0, 1, 0);
  2200. ZIndex = 101;
  2201. Parent = KeybindOuter;
  2202. });
  2203.  
  2204. Library:AddToRegistry(KeybindInner, {
  2205. BackgroundColor3 = 'MainColor';
  2206. BorderColor3 = 'OutlineColor';
  2207. }, true);
  2208.  
  2209. local ColorFrame = Library:Create('Frame', {
  2210. BackgroundColor3 = Library.AccentColor;
  2211. BorderSizePixel = 0;
  2212. Size = UDim2.new(1, 0, 0, 2);
  2213. ZIndex = 102;
  2214. Parent = KeybindInner;
  2215. });
  2216.  
  2217. Library:AddToRegistry(ColorFrame, {
  2218. BackgroundColor3 = 'AccentColor';
  2219. }, true);
  2220.  
  2221. local KeybindLabel = Library:CreateLabel({
  2222. Size = UDim2.new(1, 0, 0, 20);
  2223. Position = UDim2.fromOffset(5, 2),
  2224. TextXAlignment = Enum.TextXAlignment.Left,
  2225.  
  2226. Text = 'Keybinds';
  2227. ZIndex = 104;
  2228. Parent = KeybindInner;
  2229. });
  2230.  
  2231. local KeybindContainer = Library:Create('Frame', {
  2232. BackgroundTransparency = 1;
  2233. Size = UDim2.new(1, 0, 1, -20);
  2234. Position = UDim2.new(0, 0, 0, 20);
  2235. ZIndex = 1;
  2236. Parent = KeybindInner;
  2237. });
  2238.  
  2239. Library:Create('UIListLayout', {
  2240. FillDirection = Enum.FillDirection.Vertical;
  2241. SortOrder = Enum.SortOrder.LayoutOrder;
  2242. Parent = KeybindContainer;
  2243. });
  2244.  
  2245. Library:Create('UIPadding', {
  2246. PaddingLeft = UDim.new(0, 5),
  2247. Parent = KeybindContainer,
  2248. })
  2249.  
  2250. Library.KeybindFrame = KeybindOuter;
  2251. Library.KeybindContainer = KeybindContainer;
  2252. Library:MakeDraggable(KeybindOuter);
  2253. end;
  2254.  
  2255. function Library:SetWatermarkVisibility(Bool)
  2256. Library.Watermark.Visible = Bool;
  2257. end;
  2258.  
  2259. function Library:SetWatermark(Text)
  2260. local X, Y = Library:GetTextBounds(Text, Enum.Font.Code, 14);
  2261. Library.Watermark.Size = UDim2.new(0, X + 15, 0, (Y * 1.5) + 3);
  2262. Library:SetWatermarkVisibility(true)
  2263.  
  2264. Library.WatermarkText.Text = Text;
  2265. end;
  2266.  
  2267. function Library:Notify(Text, Time)
  2268. local XSize, YSize = Library:GetTextBounds(Text, Enum.Font.Code, 14);
  2269.  
  2270. YSize = YSize + 7
  2271.  
  2272. local NotifyOuter = Library:Create('Frame', {
  2273. BorderColor3 = Color3.new(0, 0, 0);
  2274. Position = UDim2.new(0, 100, 0, 10);
  2275. Size = UDim2.new(0, 0, 0, YSize);
  2276. ClipsDescendants = true;
  2277. ZIndex = 100;
  2278. Parent = Library.NotificationArea;
  2279. });
  2280.  
  2281. local NotifyInner = Library:Create('Frame', {
  2282. BackgroundColor3 = Library.MainColor;
  2283. BorderColor3 = Library.OutlineColor;
  2284. BorderMode = Enum.BorderMode.Inset;
  2285. Size = UDim2.new(1, 0, 1, 0);
  2286. ZIndex = 101;
  2287. Parent = NotifyOuter;
  2288. });
  2289.  
  2290. Library:AddToRegistry(NotifyInner, {
  2291. BackgroundColor3 = 'MainColor';
  2292. BorderColor3 = 'OutlineColor';
  2293. }, true);
  2294.  
  2295. local InnerFrame = Library:Create('Frame', {
  2296. BackgroundColor3 = Color3.new(1, 1, 1);
  2297. BorderSizePixel = 0;
  2298. Position = UDim2.new(0, 1, 0, 1);
  2299. Size = UDim2.new(1, -2, 1, -2);
  2300. ZIndex = 102;
  2301. Parent = NotifyInner;
  2302. });
  2303.  
  2304. local Gradient = Library:Create('UIGradient', {
  2305. Color = ColorSequence.new({
  2306. ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  2307. ColorSequenceKeypoint.new(1, Library.MainColor),
  2308. });
  2309. Rotation = -90;
  2310. Parent = InnerFrame;
  2311. });
  2312.  
  2313. Library:AddToRegistry(Gradient, {
  2314. Color = function()
  2315. return ColorSequence.new({
  2316. ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  2317. ColorSequenceKeypoint.new(1, Library.MainColor),
  2318. });
  2319. end
  2320. });
  2321.  
  2322. local NotifyLabel = Library:CreateLabel({
  2323. Position = UDim2.new(0, 4, 0, 0);
  2324. Size = UDim2.new(1, -4, 1, 0);
  2325. Text = Text;
  2326. TextXAlignment = Enum.TextXAlignment.Left;
  2327. TextSize = 14;
  2328. ZIndex = 103;
  2329. Parent = InnerFrame;
  2330. });
  2331.  
  2332. local LeftColor = Library:Create('Frame', {
  2333. BackgroundColor3 = Library.AccentColor;
  2334. BorderSizePixel = 0;
  2335. Position = UDim2.new(0, -1, 0, -1);
  2336. Size = UDim2.new(0, 3, 1, 2);
  2337. ZIndex = 104;
  2338. Parent = NotifyOuter;
  2339. });
  2340.  
  2341. Library:AddToRegistry(LeftColor, {
  2342. BackgroundColor3 = 'AccentColor';
  2343. }, true);
  2344.  
  2345. pcall(NotifyOuter.TweenSize, NotifyOuter, UDim2.new(0, XSize + 8 + 4, 0, YSize), 'Out', 'Quad', 0.4, true);
  2346.  
  2347. task.spawn(function()
  2348. warn("starting ", Time)
  2349. wait(5);
  2350.  
  2351. warn("tweening")
  2352. pcall(NotifyOuter.TweenSize, NotifyOuter, UDim2.new(0, 0, 0, YSize), 'Out', 'Quad', 0.4, true);
  2353. wait(0.4);
  2354. warn("destroying")
  2355. NotifyOuter:Destroy();
  2356. end);
  2357. end;
  2358.  
  2359. function Library:CreateWindow(...)
  2360. local Arguments = { ... }
  2361. local Config = { AnchorPoint = Vector2.zero }
  2362.  
  2363. if type(...) == 'table' then
  2364. Config = ...;
  2365. else
  2366. Config.Title = Arguments[1]
  2367. Config.AutoShow = Arguments[2] or false;
  2368. end
  2369.  
  2370. if type(Config.Title) ~= 'string' then Config.Title = 'No title' end
  2371.  
  2372. if typeof(Config.Position) ~= 'UDim2' then Config.Position = UDim2.fromOffset(175, 50) end
  2373. if typeof(Config.Size) ~= 'UDim2' then Config.Size = UDim2.fromOffset(550, 600) end
  2374.  
  2375. if Config.Center then
  2376. Config.AnchorPoint = Vector2.new(0.5, 0.5)
  2377. Config.Position = UDim2.fromScale(0.5, 0.5)
  2378. end
  2379.  
  2380. local Window = {
  2381. Tabs = {};
  2382. };
  2383.  
  2384. local Outer = Library:Create('Frame', {
  2385. AnchorPoint = Config.AnchorPoint,
  2386. BackgroundColor3 = Color3.new(0, 0, 0);
  2387. BorderSizePixel = 0;
  2388. Position = Config.Position,
  2389. Size = Config.Size,
  2390. Visible = false;
  2391. ZIndex = 1;
  2392. Parent = ScreenGui;
  2393. });
  2394.  
  2395. Library:MakeDraggable(Outer, 25);
  2396.  
  2397. local Inner = Library:Create('Frame', {
  2398. BackgroundColor3 = Library.MainColor;
  2399. BorderColor3 = Library.AccentColor;
  2400. BorderMode = Enum.BorderMode.Inset;
  2401. Position = UDim2.new(0, 1, 0, 1);
  2402. Size = UDim2.new(1, -2, 1, -2);
  2403. ZIndex = 1;
  2404. Parent = Outer;
  2405. });
  2406.  
  2407. Library:AddToRegistry(Inner, {
  2408. BackgroundColor3 = 'MainColor';
  2409. BorderColor3 = 'AccentColor';
  2410. });
  2411.  
  2412. local WindowLabel = Library:CreateLabel({
  2413. Position = UDim2.new(0, 7, 0, 0);
  2414. Size = UDim2.new(0, 0, 0, 25);
  2415. Text = Config.Title or '';
  2416. TextXAlignment = Enum.TextXAlignment.Left;
  2417. ZIndex = 1;
  2418. Parent = Inner;
  2419. });
  2420.  
  2421. local MainSectionOuter = Library:Create('Frame', {
  2422. BackgroundColor3 = Library.BackgroundColor;
  2423. BorderColor3 = Library.OutlineColor;
  2424. Position = UDim2.new(0, 8, 0, 25);
  2425. Size = UDim2.new(1, -16, 1, -33);
  2426. ZIndex = 1;
  2427. Parent = Inner;
  2428. });
  2429.  
  2430. Library:AddToRegistry(MainSectionOuter, {
  2431. BackgroundColor3 = 'BackgroundColor';
  2432. BorderColor3 = 'OutlineColor';
  2433. });
  2434.  
  2435. local MainSectionInner = Library:Create('Frame', {
  2436. BackgroundColor3 = Library.BackgroundColor;
  2437. BorderColor3 = Color3.new(0, 0, 0);
  2438. BorderMode = Enum.BorderMode.Inset;
  2439. Position = UDim2.new(0, 0, 0, 0);
  2440. Size = UDim2.new(1, 0, 1, 0);
  2441. ZIndex = 1;
  2442. Parent = MainSectionOuter;
  2443. });
  2444.  
  2445. Library:AddToRegistry(MainSectionInner, {
  2446. BackgroundColor3 = 'BackgroundColor';
  2447. });
  2448.  
  2449. local TabArea = Library:Create('Frame', {
  2450. BackgroundTransparency = 1;
  2451. Position = UDim2.new(0, 8, 0, 8);
  2452. Size = UDim2.new(1, -16, 0, 21);
  2453. ZIndex = 1;
  2454. Parent = MainSectionInner;
  2455. });
  2456.  
  2457. Library:Create('UIListLayout', {
  2458. Padding = UDim.new(0, 0);
  2459. FillDirection = Enum.FillDirection.Horizontal;
  2460. SortOrder = Enum.SortOrder.LayoutOrder;
  2461. Parent = TabArea;
  2462. });
  2463.  
  2464. local TabContainer = Library:Create('Frame', {
  2465. BackgroundColor3 = Library.MainColor;
  2466. BorderColor3 = Library.OutlineColor;
  2467. Position = UDim2.new(0, 8, 0, 30);
  2468. Size = UDim2.new(1, -16, 1, -38);
  2469. ZIndex = 2;
  2470. Parent = MainSectionInner;
  2471. });
  2472.  
  2473. Library:AddToRegistry(TabContainer, {
  2474. BackgroundColor3 = 'MainColor';
  2475. BorderColor3 = 'OutlineColor';
  2476. });
  2477.  
  2478. function Window:SetWindowTitle(Title)
  2479. WindowLabel.Text = Title;
  2480. end;
  2481.  
  2482. function Window:AddTab(Name)
  2483. local Tab = {
  2484. Groupboxes = {};
  2485. Tabboxes = {};
  2486. };
  2487.  
  2488. local TabButtonWidth = Library:GetTextBounds(Name, Enum.Font.Code, 16);
  2489.  
  2490. local TabButton = Library:Create('Frame', {
  2491. BackgroundColor3 = Library.BackgroundColor;
  2492. BorderColor3 = Library.OutlineColor;
  2493. Size = UDim2.new(0, TabButtonWidth + 8 + 4, 1, 0);
  2494. ZIndex = 1;
  2495. Parent = TabArea;
  2496. });
  2497.  
  2498. Library:AddToRegistry(TabButton, {
  2499. BackgroundColor3 = 'BackgroundColor';
  2500. BorderColor3 = 'OutlineColor';
  2501. });
  2502.  
  2503. local TabButtonLabel = Library:CreateLabel({
  2504. Position = UDim2.new(0, 0, 0, 0);
  2505. Size = UDim2.new(1, 0, 1, -1);
  2506. Text = Name;
  2507. ZIndex = 1;
  2508. Parent = TabButton;
  2509. });
  2510.  
  2511. local Blocker = Library:Create('Frame', {
  2512. BackgroundColor3 = Library.MainColor;
  2513. BorderSizePixel = 0;
  2514. Position = UDim2.new(0, 0, 1, 0);
  2515. Size = UDim2.new(1, 0, 0, 1);
  2516. BackgroundTransparency = 1;
  2517. ZIndex = 3;
  2518. Parent = TabButton;
  2519. });
  2520.  
  2521. Library:AddToRegistry(Blocker, {
  2522. BackgroundColor3 = 'MainColor';
  2523. });
  2524.  
  2525. local TabFrame = Library:Create('Frame', {
  2526. BackgroundTransparency = 1;
  2527. Position = UDim2.new(0, 0, 0, 0);
  2528. Size = UDim2.new(1, 0, 1, 0);
  2529. Visible = false;
  2530. ZIndex = 2;
  2531. Parent = TabContainer;
  2532. });
  2533.  
  2534. local LeftSide = Library:Create('Frame', {
  2535. BackgroundTransparency = 1;
  2536. Position = UDim2.new(0, 8, 0, 8);
  2537. Size = UDim2.new(0.5, -12, 0, 507);
  2538. ZIndex = 2;
  2539. Parent = TabFrame;
  2540. });
  2541.  
  2542. local RightSide = Library:Create('Frame', {
  2543. BackgroundTransparency = 1;
  2544. Position = UDim2.new(0.5, 4, 0, 8);
  2545. Size = UDim2.new(0.5, -12, 0, 507);
  2546. ZIndex = 2;
  2547. Parent = TabFrame;
  2548. });
  2549.  
  2550. Library:Create('UIListLayout', {
  2551. Padding = UDim.new(0, 8);
  2552. FillDirection = Enum.FillDirection.Vertical;
  2553. SortOrder = Enum.SortOrder.LayoutOrder;
  2554. Parent = LeftSide;
  2555. });
  2556.  
  2557. Library:Create('UIListLayout', {
  2558. Padding = UDim.new(0, 8);
  2559. FillDirection = Enum.FillDirection.Vertical;
  2560. SortOrder = Enum.SortOrder.LayoutOrder;
  2561. Parent = RightSide;
  2562. });
  2563.  
  2564. function Tab:ShowTab()
  2565. for _, Tab in next, Window.Tabs do
  2566. Tab:HideTab();
  2567. end;
  2568.  
  2569. Blocker.BackgroundTransparency = 0;
  2570. TabButton.BackgroundColor3 = Library.MainColor;
  2571. Library.RegistryMap[TabButton].Properties.BackgroundColor3 = 'MainColor';
  2572. TabFrame.Visible = true;
  2573. end;
  2574.  
  2575. function Tab:HideTab()
  2576. Blocker.BackgroundTransparency = 1;
  2577. TabButton.BackgroundColor3 = Library.BackgroundColor;
  2578. Library.RegistryMap[TabButton].Properties.BackgroundColor3 = 'BackgroundColor';
  2579. TabFrame.Visible = false;
  2580. end;
  2581.  
  2582. function Tab:AddGroupbox(Info)
  2583. local Groupbox = {};
  2584.  
  2585. local BoxOuter = Library:Create('Frame', {
  2586. BackgroundColor3 = Library.BackgroundColor;
  2587. BorderColor3 = Library.OutlineColor;
  2588. Size = UDim2.new(1, 0, 0, 507);
  2589. ZIndex = 2;
  2590. Parent = Info.Side == 1 and LeftSide or RightSide;
  2591. });
  2592.  
  2593. Library:AddToRegistry(BoxOuter, {
  2594. BackgroundColor3 = 'BackgroundColor';
  2595. BorderColor3 = 'OutlineColor';
  2596. });
  2597.  
  2598. local BoxInner = Library:Create('Frame', {
  2599. BackgroundColor3 = Library.BackgroundColor;
  2600. BorderColor3 = Color3.new(0, 0, 0);
  2601. BorderMode = Enum.BorderMode.Inset;
  2602. Size = UDim2.new(1, 0, 1, 0);
  2603. ZIndex = 4;
  2604. Parent = BoxOuter;
  2605. });
  2606.  
  2607. Library:AddToRegistry(BoxInner, {
  2608. BackgroundColor3 = 'BackgroundColor';
  2609. });
  2610.  
  2611. local Highlight = Library:Create('Frame', {
  2612. BackgroundColor3 = Library.AccentColor;
  2613. BorderSizePixel = 0;
  2614. Size = UDim2.new(1, 0, 0, 2);
  2615. ZIndex = 5;
  2616. Parent = BoxInner;
  2617. });
  2618.  
  2619. Library:AddToRegistry(Highlight, {
  2620. BackgroundColor3 = 'AccentColor';
  2621. });
  2622.  
  2623. local GroupboxLabel = Library:CreateLabel({
  2624. Size = UDim2.new(1, 0, 0, 18);
  2625. Position = UDim2.new(0, 4, 0, 2);
  2626. TextSize = 14;
  2627. Text = Info.Name;
  2628. TextXAlignment = Enum.TextXAlignment.Left;
  2629. ZIndex = 5;
  2630. Parent = BoxInner;
  2631. });
  2632.  
  2633. local Container = Library:Create('Frame', {
  2634. BackgroundTransparency = 1;
  2635. Position = UDim2.new(0, 4, 0, 20);
  2636. Size = UDim2.new(1, -4, 1, -20);
  2637. ZIndex = 1;
  2638. Parent = BoxInner;
  2639. });
  2640.  
  2641. Library:Create('UIListLayout', {
  2642. FillDirection = Enum.FillDirection.Vertical;
  2643. SortOrder = Enum.SortOrder.LayoutOrder;
  2644. Parent = Container;
  2645. });
  2646.  
  2647. function Groupbox:Resize()
  2648. local Size = 0;
  2649.  
  2650. for _, Element in next, Groupbox.Container:GetChildren() do
  2651. if not Element:IsA('UIListLayout') then
  2652. Size = Size + Element.Size.Y.Offset;
  2653. end;
  2654. end;
  2655.  
  2656. BoxOuter.Size = UDim2.new(1, 0, 0, 20 + Size + 2);
  2657. end;
  2658.  
  2659. Groupbox.Container = Container;
  2660. setmetatable(Groupbox, BaseGroupbox);
  2661.  
  2662. Groupbox:AddBlank(3);
  2663. Groupbox:Resize();
  2664.  
  2665. Tab.Groupboxes[Info.Name] = Groupbox;
  2666.  
  2667. return Groupbox;
  2668. end;
  2669.  
  2670. function Tab:AddLeftGroupbox(Name)
  2671. return Tab:AddGroupbox({ Side = 1; Name = Name; });
  2672. end;
  2673.  
  2674. function Tab:AddRightGroupbox(Name)
  2675. return Tab:AddGroupbox({ Side = 2; Name = Name; });
  2676. end;
  2677.  
  2678. function Tab:AddTabbox(Info)
  2679. local Tabbox = {
  2680. Tabs = {};
  2681. };
  2682.  
  2683. local BoxOuter = Library:Create('Frame', {
  2684. BackgroundColor3 = Library.BackgroundColor;
  2685. BorderColor3 = Library.OutlineColor;
  2686. Size = UDim2.new(1, 0, 0, 0);
  2687. ZIndex = 2;
  2688. Parent = Info.Side == 1 and LeftSide or RightSide;
  2689. });
  2690.  
  2691. Library:AddToRegistry(BoxOuter, {
  2692. BackgroundColor3 = 'BackgroundColor';
  2693. BorderColor3 = 'OutlineColor';
  2694. });
  2695.  
  2696. local BoxInner = Library:Create('Frame', {
  2697. BackgroundColor3 = Library.BackgroundColor;
  2698. BorderColor3 = Color3.new(0, 0, 0);
  2699. BorderMode = Enum.BorderMode.Inset;
  2700. Size = UDim2.new(1, 0, 1, 0);
  2701. ZIndex = 4;
  2702. Parent = BoxOuter;
  2703. });
  2704.  
  2705. Library:AddToRegistry(BoxInner, {
  2706. BackgroundColor3 = 'BackgroundColor';
  2707. });
  2708.  
  2709. local Highlight = Library:Create('Frame', {
  2710. BackgroundColor3 = Library.AccentColor;
  2711. BorderSizePixel = 0;
  2712. Size = UDim2.new(1, 0, 0, 2);
  2713. ZIndex = 10;
  2714. Parent = BoxInner;
  2715. });
  2716.  
  2717. Library:AddToRegistry(Highlight, {
  2718. BackgroundColor3 = 'AccentColor';
  2719. });
  2720.  
  2721. local TabboxButtons = Library:Create('Frame', {
  2722. BackgroundTransparency = 1;
  2723. Position = UDim2.new(0, 0, 0, 1);
  2724. Size = UDim2.new(1, 0, 0, 18);
  2725. ZIndex = 5;
  2726. Parent = BoxInner;
  2727. });
  2728.  
  2729. Library:Create('UIListLayout', {
  2730. FillDirection = Enum.FillDirection.Horizontal;
  2731. HorizontalAlignment = Enum.HorizontalAlignment.Left;
  2732. SortOrder = Enum.SortOrder.LayoutOrder;
  2733. Parent = TabboxButtons;
  2734. });
  2735.  
  2736. function Tabbox:AddTab(Name)
  2737. local Tab = {};
  2738.  
  2739. local Button = Library:Create('Frame', {
  2740. BackgroundColor3 = Library.MainColor;
  2741. BorderColor3 = Color3.new(0, 0, 0);
  2742. Size = UDim2.new(0.5, 0, 1, 0);
  2743. ZIndex = 6;
  2744. Parent = TabboxButtons;
  2745. });
  2746.  
  2747. Library:AddToRegistry(Button, {
  2748. BackgroundColor3 = 'MainColor';
  2749. });
  2750.  
  2751. local ButtonLabel = Library:CreateLabel({
  2752. Size = UDim2.new(1, 0, 1, 0);
  2753. TextSize = 14;
  2754. Text = Name;
  2755. TextXAlignment = Enum.TextXAlignment.Center;
  2756. ZIndex = 7;
  2757. Parent = Button;
  2758. });
  2759.  
  2760. local Block = Library:Create('Frame', {
  2761. BackgroundColor3 = Library.BackgroundColor;
  2762. BorderSizePixel = 0;
  2763. Position = UDim2.new(0, 0, 1, 0);
  2764. Size = UDim2.new(1, 0, 0, 1);
  2765. Visible = false;
  2766. ZIndex = 9;
  2767. Parent = Button;
  2768. });
  2769.  
  2770. Library:AddToRegistry(Block, {
  2771. BackgroundColor3 = 'BackgroundColor';
  2772. });
  2773.  
  2774. local Container = Library:Create('Frame', {
  2775. Position = UDim2.new(0, 4, 0, 20);
  2776. Size = UDim2.new(1, -4, 1, -20);
  2777. ZIndex = 1;
  2778. Visible = false;
  2779. Parent = BoxInner;
  2780. });
  2781.  
  2782. Library:Create('UIListLayout', {
  2783. FillDirection = Enum.FillDirection.Vertical;
  2784. SortOrder = Enum.SortOrder.LayoutOrder;
  2785. Parent = Container;
  2786. });
  2787.  
  2788. function Tab:Show()
  2789. for _, Tab in next, Tabbox.Tabs do
  2790. Tab:Hide();
  2791. end;
  2792.  
  2793. Container.Visible = true;
  2794. Block.Visible = true;
  2795.  
  2796. Button.BackgroundColor3 = Library.BackgroundColor;
  2797. Library.RegistryMap[Button].Properties.BackgroundColor3 = 'BackgroundColor';
  2798. end;
  2799.  
  2800. function Tab:Hide()
  2801. Container.Visible = false;
  2802. Block.Visible = false;
  2803.  
  2804. Button.BackgroundColor3 = Library.MainColor;
  2805. Library.RegistryMap[Button].Properties.BackgroundColor3 = 'MainColor';
  2806. end;
  2807.  
  2808. function Tab:Resize()
  2809. local TabCount = 0;
  2810.  
  2811. for _, Tab in next, Tabbox.Tabs do
  2812. TabCount = TabCount + 1;
  2813. end;
  2814.  
  2815. for _, Button in next, TabboxButtons:GetChildren() do
  2816. if not Button:IsA('UIListLayout') then
  2817. Button.Size = UDim2.new(1 / TabCount, 0, 1, 0);
  2818. end;
  2819. end;
  2820.  
  2821. local Size = 0;
  2822.  
  2823. for _, Element in next, Tab.Container:GetChildren() do
  2824. if not Element:IsA('UIListLayout') then
  2825. Size = Size + Element.Size.Y.Offset;
  2826. end;
  2827. end;
  2828.  
  2829. if BoxOuter.Size.Y.Offset < 20 + Size + 2 then
  2830. BoxOuter.Size = UDim2.new(1, 0, 0, 20 + Size + 2);
  2831. end;
  2832. end;
  2833.  
  2834. Button.InputBegan:Connect(function(Input)
  2835. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  2836. Tab:Show();
  2837. end;
  2838. end);
  2839.  
  2840. Tab.Container = Container;
  2841. Tabbox.Tabs[Name] = Tab;
  2842.  
  2843. setmetatable(Tab, BaseGroupbox);
  2844.  
  2845. Tab:AddBlank(3);
  2846. Tab:Resize();
  2847.  
  2848. if #TabboxButtons:GetChildren() == 2 then
  2849. Tab:Show();
  2850. end;
  2851.  
  2852. return Tab;
  2853. end;
  2854.  
  2855. Tab.Tabboxes[Info.Name or ''] = Tabbox;
  2856.  
  2857. return Tabbox;
  2858. end;
  2859.  
  2860. function Tab:AddLeftTabbox(Name)
  2861. return Tab:AddTabbox({ Name = Name, Side = 1; });
  2862. end;
  2863.  
  2864. function Tab:AddRightTabbox(Name)
  2865. return Tab:AddTabbox({ Name = Name, Side = 2; });
  2866. end;
  2867.  
  2868. TabButton.InputBegan:Connect(function(Input)
  2869. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  2870. Tab:ShowTab();
  2871. end;
  2872. end);
  2873.  
  2874. -- This was the first tab added, so we show it by default.
  2875. if #TabContainer:GetChildren() == 1 then
  2876. Tab:ShowTab();
  2877. end;
  2878.  
  2879. Window.Tabs[Name] = Tab;
  2880. return Tab;
  2881. end;
  2882.  
  2883. local ModalElement = Library:Create('TextButton', {
  2884. BackgroundTransparency = 1;
  2885. Size = UDim2.new(0, 0, 0, 0);
  2886. Visible = true;
  2887. Text = '';
  2888. Modal = false;
  2889. Parent = ScreenGui;
  2890. });
  2891.  
  2892. function Library.Toggle()
  2893. Outer.Visible = not Outer.Visible;
  2894. ModalElement.Modal = Outer.Visible;
  2895.  
  2896. local oIcon = Mouse.Icon;
  2897. local State = InputService.MouseIconEnabled;
  2898.  
  2899. local Cursor = Drawing.new('Triangle');
  2900. Cursor.Thickness = 1;
  2901. Cursor.Filled = true;
  2902.  
  2903. while Outer.Visible do
  2904. local mPos = workspace.CurrentCamera:WorldToViewportPoint(Mouse.Hit.p);
  2905.  
  2906. Cursor.Color = Library.AccentColor;
  2907. Cursor.PointA = Vector2.new(mPos.X, mPos.Y);
  2908. Cursor.PointB = Vector2.new(mPos.X, mPos.Y) + Vector2.new(6, 14);
  2909. Cursor.PointC = Vector2.new(mPos.X, mPos.Y) + Vector2.new(-6, 14);
  2910.  
  2911. Cursor.Visible = not InputService.MouseIconEnabled;
  2912.  
  2913. RenderStepped:Wait();
  2914. end;
  2915.  
  2916. Cursor:Remove();
  2917. end
  2918.  
  2919. Library:GiveSignal(InputService.InputBegan:Connect(function(Input, Processed)
  2920. if type(Library.ToggleKeybind) == 'table' and Library.ToggleKeybind.Type == 'KeyPicker' then
  2921. if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode.Name == Library.ToggleKeybind.Value then
  2922. task.spawn(Library.Toggle)
  2923. end
  2924. elseif Input.KeyCode == Enum.KeyCode.RightControl or (Input.KeyCode == Enum.KeyCode.RightShift and (not Processed)) then
  2925. task.spawn(Library.Toggle)
  2926. end
  2927. end))
  2928.  
  2929. if Config.AutoShow then task.spawn(Library.Toggle) end
  2930.  
  2931. Window.Holder = Outer;
  2932.  
  2933. return Window;
  2934. end;
  2935.  
  2936. return Library
Add Comment
Please, Sign In to add comment