pipocochigato1

aaaaaaaaaaaaaaaa

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