Guest

1111

Apr 4th, 2026
15
0
Never
Not a member of GistPad yet? Sign Up, it unlocks many cool features!
None 379.27 KB | None | 0 0
  1. --[[
  2.  
  3. Milenium Library
  4. -> Made by @finobe
  5. -> Kind of got bored idk what to do with life
  6. -> Idk who or why this got leaked, ui was VERY popular and high in demand with customers
  7. ]]
  8.  
  9. -- Variables
  10. local uis = game:GetService("UserInputService")
  11. local players = game:GetService("Players")
  12. local ws = game:GetService("Workspace")
  13. local rs = game:GetService("ReplicatedStorage")
  14. local http_service = game:GetService("HttpService")
  15. local gui_service = game:GetService("GuiService")
  16. local lighting = game:GetService("Lighting")
  17. local run = game:GetService("RunService")
  18. local stats = game:GetService("Stats")
  19. local coregui = game:GetService("CoreGui")
  20. local debris = game:GetService("Debris")
  21. local tween_service = game:GetService("TweenService")
  22. local sound_service = game:GetService("SoundService")
  23.  
  24. local vec2 = Vector2.new
  25. local vec3 = Vector3.new
  26. local dim2 = UDim2.new
  27. local dim = UDim.new
  28. local rect = Rect.new
  29. local cfr = CFrame.new
  30. local empty_cfr = cfr()
  31. local point_object_space = empty_cfr.PointToObjectSpace
  32. local angle = CFrame.Angles
  33. local dim_offset = UDim2.fromOffset
  34.  
  35. local color = Color3.new
  36. local rgb = Color3.fromRGB
  37. local hex = Color3.fromHex
  38. local hsv = Color3.fromHSV
  39. local rgbseq = ColorSequence.new
  40. local rgbkey = ColorSequenceKeypoint.new
  41. local numseq = NumberSequence.new
  42. local numkey = NumberSequenceKeypoint.new
  43.  
  44. local camera = ws.CurrentCamera
  45. local lp = players.LocalPlayer
  46. local mouse = lp:GetMouse()
  47. local gui_offset = gui_service:GetGuiInset().Y
  48.  
  49. local max = math.max
  50. local floor = math.floor
  51. local min = math.min
  52. local abs = math.abs
  53. local noise = math.noise
  54. local rad = math.rad
  55. local random = math.random
  56. local pow = math.pow
  57. local sin = math.sin
  58. local pi = math.pi
  59. local tan = math.tan
  60. local atan2 = math.atan2
  61. local clamp = math.clamp
  62.  
  63. local insert = table.insert
  64. local find = table.find
  65. local remove = table.remove
  66. local concat = table.concat
  67. --
  68.  
  69. -- Library init
  70. getgenv().library = {
  71. directory = "milenium",
  72. folders = {
  73. "/fonts",
  74. "/configs",
  75. },
  76. flags = {},
  77. config_flags = {},
  78. connections = {},
  79. notifications = {notifs = {}},
  80. current_open;
  81. }
  82.  
  83. local themes = {
  84. preset = {
  85. accent = rgb(155, 150, 219),
  86. },
  87.  
  88. utility = {
  89. accent = {
  90. BackgroundColor3 = {},
  91. TextColor3 = {},
  92. ImageColor3 = {},
  93. ScrollBarImageColor3 = {}
  94. },
  95. }
  96. }
  97.  
  98. local keys = {
  99. [Enum.KeyCode.LeftShift] = "LS",
  100. [Enum.KeyCode.RightShift] = "RS",
  101. [Enum.KeyCode.LeftControl] = "LC",
  102. [Enum.KeyCode.RightControl] = "RC",
  103. [Enum.KeyCode.Insert] = "INS",
  104. [Enum.KeyCode.Backspace] = "BS",
  105. [Enum.KeyCode.Return] = "Ent",
  106. [Enum.KeyCode.LeftAlt] = "LA",
  107. [Enum.KeyCode.RightAlt] = "RA",
  108. [Enum.KeyCode.CapsLock] = "CAPS",
  109. [Enum.KeyCode.One] = "1",
  110. [Enum.KeyCode.Two] = "2",
  111. [Enum.KeyCode.Three] = "3",
  112. [Enum.KeyCode.Four] = "4",
  113. [Enum.KeyCode.Five] = "5",
  114. [Enum.KeyCode.Six] = "6",
  115. [Enum.KeyCode.Seven] = "7",
  116. [Enum.KeyCode.Eight] = "8",
  117. [Enum.KeyCode.Nine] = "9",
  118. [Enum.KeyCode.Zero] = "0",
  119. [Enum.KeyCode.KeypadOne] = "Num1",
  120. [Enum.KeyCode.KeypadTwo] = "Num2",
  121. [Enum.KeyCode.KeypadThree] = "Num3",
  122. [Enum.KeyCode.KeypadFour] = "Num4",
  123. [Enum.KeyCode.KeypadFive] = "Num5",
  124. [Enum.KeyCode.KeypadSix] = "Num6",
  125. [Enum.KeyCode.KeypadSeven] = "Num7",
  126. [Enum.KeyCode.KeypadEight] = "Num8",
  127. [Enum.KeyCode.KeypadNine] = "Num9",
  128. [Enum.KeyCode.KeypadZero] = "Num0",
  129. [Enum.KeyCode.Minus] = "-",
  130. [Enum.KeyCode.Equals] = "=",
  131. [Enum.KeyCode.Tilde] = "~",
  132. [Enum.KeyCode.LeftBracket] = "[",
  133. [Enum.KeyCode.RightBracket] = "]",
  134. [Enum.KeyCode.RightParenthesis] = ")",
  135. [Enum.KeyCode.LeftParenthesis] = "(",
  136. [Enum.KeyCode.Semicolon] = ",",
  137. [Enum.KeyCode.Quote] = "'",
  138. [Enum.KeyCode.BackSlash] = "\\",
  139. [Enum.KeyCode.Comma] = ",",
  140. [Enum.KeyCode.Period] = ".",
  141. [Enum.KeyCode.Slash] = "/",
  142. [Enum.KeyCode.Asterisk] = "*",
  143. [Enum.KeyCode.Plus] = "+",
  144. [Enum.KeyCode.Period] = ".",
  145. [Enum.KeyCode.Backquote] = "`",
  146. [Enum.UserInputType.MouseButton1] = "MB1",
  147. [Enum.UserInputType.MouseButton2] = "MB2",
  148. [Enum.UserInputType.MouseButton3] = "MB3",
  149. [Enum.KeyCode.Escape] = "ESC",
  150. [Enum.KeyCode.Space] = "SPC",
  151. }
  152.  
  153. library.__index = library
  154.  
  155. for _, path in next, library.folders do
  156. makefolder(library.directory .. path)
  157. end
  158.  
  159. local flags = library.flags
  160. local config_flags = library.config_flags
  161. local notifications = library.notifications
  162.  
  163. local fonts = {}; do
  164. function Register_Font(Name, Weight, Style, Asset)
  165. if not isfile(Asset.Id) then
  166. writefile(Asset.Id, Asset.Font)
  167. end
  168.  
  169. if isfile(Name .. ".font") then
  170. delfile(Name .. ".font")
  171. end
  172.  
  173. local Data = {
  174. name = Name,
  175. faces = {
  176. {
  177. name = "Normal",
  178. weight = Weight,
  179. style = Style,
  180. assetId = getcustomasset(Asset.Id),
  181. },
  182. },
  183. }
  184.  
  185. writefile(Name .. ".font", http_service:JSONEncode(Data))
  186.  
  187. return getcustomasset(Name .. ".font");
  188. end
  189.  
  190. local Medium = Register_Font("Medium", 200, "Normal", {
  191. Id = "Medium.ttf",
  192. })
  193.  
  194. local SemiBold = Register_Font("SemiBold", 200, "Normal", {
  195. Id = "SemiBold.ttf",
  196. })
  197.  
  198. fonts = {
  199. small = Font.new(Medium, Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  200. font = Font.new(SemiBold, Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  201. }
  202. end
  203. --
  204.  
  205. -- Library functions
  206. -- Misc functions
  207. function library:tween(obj, properties, easing_style, time)
  208. local tween = tween_service:Create(obj, TweenInfo.new(time or 0.25, easing_style or Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false, 0), properties):Play()
  209.  
  210. return tween
  211. end
  212.  
  213. function library:resizify(frame)
  214. local Frame = Instance.new("TextButton")
  215. Frame.Position = dim2(1, -10, 1, -10)
  216. Frame.BorderColor3 = rgb(0, 0, 0)
  217. Frame.Size = dim2(0, 10, 0, 10)
  218. Frame.BorderSizePixel = 0
  219. Frame.BackgroundColor3 = rgb(255, 255, 255)
  220. Frame.Parent = frame
  221. Frame.BackgroundTransparency = 1
  222. Frame.Text = ""
  223.  
  224. local resizing = false
  225. local start_size
  226. local start
  227. local og_size = frame.Size
  228.  
  229. Frame.InputBegan:Connect(function(input)
  230. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  231. resizing = true
  232. start = input.Position
  233. start_size = frame.Size
  234. end
  235. end)
  236.  
  237. Frame.InputEnded:Connect(function(input)
  238. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  239. resizing = false
  240. end
  241. end)
  242.  
  243. library:connection(uis.InputChanged, function(input, game_event)
  244. if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then
  245. local viewport_x = camera.ViewportSize.X
  246. local viewport_y = camera.ViewportSize.Y
  247.  
  248. local current_size = dim2(
  249. start_size.X.Scale,
  250. math.clamp(
  251. start_size.X.Offset + (input.Position.X - start.X),
  252. og_size.X.Offset,
  253. viewport_x
  254. ),
  255. start_size.Y.Scale,
  256. math.clamp(
  257. start_size.Y.Offset + (input.Position.Y - start.Y),
  258. og_size.Y.Offset,
  259. viewport_y
  260. )
  261. )
  262.  
  263. library:tween(frame, {Size = current_size}, Enum.EasingStyle.Linear, 0.05)
  264. end
  265. end)
  266. end
  267.  
  268. function fag(tbl)
  269. local Size = 0
  270.  
  271. for _ in tbl do
  272. Size = Size + 1
  273. end
  274.  
  275. return Size
  276. end
  277.  
  278. function library:next_flag()
  279. local index = fag(library.flags) + 1;
  280. local str = string.format("flagnumber%s", index)
  281.  
  282. return str;
  283. end
  284.  
  285. function library:mouse_in_frame(uiobject)
  286. local y_cond = uiobject.AbsolutePosition.Y <= mouse.Y and mouse.Y <= uiobject.AbsolutePosition.Y + uiobject.AbsoluteSize.Y
  287. local x_cond = uiobject.AbsolutePosition.X <= mouse.X and mouse.X <= uiobject.AbsolutePosition.X + uiobject.AbsoluteSize.X
  288.  
  289. return (y_cond and x_cond)
  290. end
  291.  
  292. function library:draggify(frame)
  293. local dragging = false
  294. local start_size = frame.Position
  295. local start
  296.  
  297. frame.InputBegan:Connect(function(input)
  298. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  299. dragging = true
  300. start = input.Position
  301. start_size = frame.Position
  302. end
  303. end)
  304.  
  305. frame.InputEnded:Connect(function(input)
  306. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  307. dragging = false
  308. end
  309. end)
  310.  
  311. library:connection(uis.InputChanged, function(input, game_event)
  312. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  313. local viewport_x = camera.ViewportSize.X
  314. local viewport_y = camera.ViewportSize.Y
  315.  
  316. local current_position = dim2(
  317. 0,
  318. clamp(
  319. start_size.X.Offset + (input.Position.X - start.X),
  320. 0,
  321. viewport_x - frame.Size.X.Offset
  322. ),
  323. 0,
  324. math.clamp(
  325. start_size.Y.Offset + (input.Position.Y - start.Y),
  326. 0,
  327. viewport_y - frame.Size.Y.Offset
  328. )
  329. )
  330.  
  331. library:tween(frame, {Position = current_position}, Enum.EasingStyle.Linear, 0.05)
  332. library:close_element()
  333. end
  334. end)
  335. end
  336.  
  337. function library:convert(str)
  338. local values = {}
  339.  
  340. for value in string.gmatch(str, "[^,]+") do
  341. insert(values, tonumber(value))
  342. end
  343.  
  344. if #values == 4 then
  345. return unpack(values)
  346. else
  347. return
  348. end
  349. end
  350.  
  351. function library:convert_enum(enum)
  352. local enum_parts = {}
  353.  
  354. for part in string.gmatch(enum, "[%w_]+") do
  355. insert(enum_parts, part)
  356. end
  357.  
  358. local enum_table = Enum
  359. for i = 2, #enum_parts do
  360. local enum_item = enum_table[enum_parts[i]]
  361.  
  362. enum_table = enum_item
  363. end
  364.  
  365. return enum_table
  366. end
  367.  
  368. local config_holder;
  369. function library:update_config_list()
  370. if not config_holder then
  371. return
  372. end
  373.  
  374. local list = {}
  375.  
  376. for idx, file in listfiles(library.directory .. "/configs") do
  377. local name = file:gsub(library.directory .. "/configs\\", ""):gsub(".cfg", ""):gsub(library.directory .. "\\configs\\", "")
  378. list[#list + 1] = name
  379. end
  380.  
  381. config_holder.refresh_options(list)
  382. end
  383.  
  384. function library:get_config()
  385. local Config = {}
  386.  
  387. for _, v in next, flags do
  388. if type(v) == "table" and v.key then
  389. Config[_] = {active = v.active, mode = v.mode, key = tostring(v.key)}
  390. elseif type(v) == "table" and v["Transparency"] and v["Color"] then
  391. Config[_] = {Transparency = v["Transparency"], Color = v["Color"]:ToHex()}
  392. else
  393. Config[_] = v
  394. end
  395. end
  396.  
  397. return http_service:JSONEncode(Config)
  398. end
  399.  
  400. function library:load_config(config_json)
  401. local config = http_service:JSONDecode(config_json)
  402.  
  403. for _, v in config do
  404. local function_set = library.config_flags[_]
  405.  
  406. if _ == "config_name_list" then
  407. continue
  408. end
  409.  
  410. if function_set then
  411. if type(v) == "table" and v["Transparency"] and v["Color"] then
  412. function_set(hex(v["Color"]), v["Transparency"])
  413. elseif type(v) == "table" and v["active"] then
  414. function_set(v)
  415. else
  416. function_set(v)
  417. end
  418. end
  419. end
  420. end
  421.  
  422. function library:round(number, float)
  423. local multiplier = 1 / (float or 1)
  424.  
  425. return floor(number * multiplier + 0.5) / multiplier
  426. end
  427.  
  428. function library:apply_theme(instance, theme, property)
  429. insert(themes.utility[theme][property], instance)
  430. end
  431.  
  432. function library:update_theme(theme, color)
  433. for _, property in themes.utility[theme] do
  434.  
  435. for m, object in property do
  436. if object[_] == themes.preset[theme] then
  437. object[_] = color
  438. end
  439. end
  440. end
  441.  
  442. themes.preset[theme] = color
  443. end
  444.  
  445. function library:connection(signal, callback)
  446. local connection = signal:Connect(callback)
  447.  
  448. insert(library.connections, connection)
  449.  
  450. return connection
  451. end
  452.  
  453. function library:close_element(new_path)
  454. local open_element = library.current_open
  455.  
  456. if open_element and new_path ~= open_element then
  457. open_element.set_visible(false)
  458. open_element.open = false;
  459. end
  460.  
  461. if new_path ~= open_element then
  462. library.current_open = new_path or nil;
  463. end
  464. end
  465.  
  466. function library:create(instance, options)
  467. local ins = Instance.new(instance)
  468.  
  469. for prop, value in options do
  470. ins[prop] = value
  471. end
  472.  
  473. return ins
  474. end
  475.  
  476. function library:unload_menu()
  477. if library[ "items" ] then
  478. library[ "items" ]:Destroy()
  479. end
  480.  
  481. if library[ "other" ] then
  482. library[ "other" ]:Destroy()
  483. end
  484.  
  485. for index, connection in library.connections do
  486. connection:Disconnect()
  487. connection = nil
  488. end
  489.  
  490. library = nil
  491. end
  492. --
  493.  
  494. -- Library element functions
  495. function library:window(properties)
  496. local cfg = {
  497. suffix = properties.suffix or properties.Suffix or "tech";
  498. name = properties.name or properties.Name or "nebula";
  499. game_name = properties.gameInfo or properties.game_info or properties.GameInfo or "Milenium for Counter-Strike: Global Offensive";
  500. size = properties.size or properties.Size or dim2(0, 700, 0, 565);
  501. selected_tab;
  502. items = {};
  503.  
  504. tween;
  505. }
  506.  
  507. library[ "items" ] = library:create( "ScreenGui" , {
  508. Parent = coregui;
  509. Name = "\0";
  510. Enabled = true;
  511. ZIndexBehavior = Enum.ZIndexBehavior.Global;
  512. IgnoreGuiInset = true;
  513. });
  514.  
  515. library[ "other" ] = library:create( "ScreenGui" , {
  516. Parent = coregui;
  517. Name = "\0";
  518. Enabled = false;
  519. ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
  520. IgnoreGuiInset = true;
  521. });
  522.  
  523. local items = cfg.items; do
  524. items[ "main" ] = library:create( "Frame" , {
  525. Parent = library[ "items" ];
  526. Size = cfg.size;
  527. Name = "\0";
  528. Position = dim2(0.5, -cfg.size.X.Offset / 2, 0.5, -cfg.size.Y.Offset / 2);
  529. BorderColor3 = rgb(0, 0, 0);
  530. BorderSizePixel = 0;
  531. BackgroundColor3 = rgb(14, 14, 16)
  532. }); items[ "main" ].Position = dim2(0, items[ "main" ].AbsolutePosition.X, 0, items[ "main" ].AbsolutePosition.Y)
  533.  
  534. library:create( "UICorner" , {
  535. Parent = items[ "main" ];
  536. CornerRadius = dim(0, 10)
  537. });
  538.  
  539. library:create( "UIStroke" , {
  540. Color = rgb(23, 23, 29);
  541. Parent = items[ "main" ];
  542. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  543. });
  544.  
  545. items[ "side_frame" ] = library:create( "Frame" , {
  546. Parent = items[ "main" ];
  547. BackgroundTransparency = 1;
  548. Name = "\0";
  549. BorderColor3 = rgb(0, 0, 0);
  550. Size = dim2(0, 196, 1, -25);
  551. BorderSizePixel = 0;
  552. BackgroundColor3 = rgb(14, 14, 16)
  553. });
  554.  
  555. library:create( "Frame" , {
  556. AnchorPoint = vec2(1, 0);
  557. Parent = items[ "side_frame" ];
  558. Position = dim2(1, 0, 0, 0);
  559. BorderColor3 = rgb(0, 0, 0);
  560. Size = dim2(0, 1, 1, 0);
  561. BorderSizePixel = 0;
  562. BackgroundColor3 = rgb(21, 21, 23)
  563. });
  564.  
  565. items[ "button_holder" ] = library:create( "Frame" , {
  566. Parent = items[ "side_frame" ];
  567. Name = "\0";
  568. BackgroundTransparency = 1;
  569. Position = dim2(0, 0, 0, 60);
  570. BorderColor3 = rgb(0, 0, 0);
  571. Size = dim2(1, 0, 1, -60);
  572. BorderSizePixel = 0;
  573. BackgroundColor3 = rgb(255, 255, 255)
  574. }); cfg.button_holder = items[ "button_holder" ];
  575.  
  576. library:create( "UIListLayout" , {
  577. Parent = items[ "button_holder" ];
  578. Padding = dim(0, 5);
  579. SortOrder = Enum.SortOrder.LayoutOrder
  580. });
  581.  
  582. library:create( "UIPadding" , {
  583. PaddingTop = dim(0, 16);
  584. PaddingBottom = dim(0, 36);
  585. Parent = items[ "button_holder" ];
  586. PaddingRight = dim(0, 11);
  587. PaddingLeft = dim(0, 10)
  588. });
  589.  
  590. local accent = themes.preset.accent
  591. items[ "title" ] = library:create( "TextLabel" , {
  592. FontFace = fonts.font;
  593. BorderColor3 = rgb(0, 0, 0);
  594. Text = name;
  595. Parent = items[ "side_frame" ];
  596. Name = "\0";
  597. Text = string.format('<u>%s</u><font color = "rgb(255, 255, 255)">%s</font>', cfg.name, cfg.suffix);
  598. BackgroundTransparency = 1;
  599. Size = dim2(1, 0, 0, 70);
  600. TextColor3 = themes.preset.accent;
  601. BorderSizePixel = 0;
  602. RichText = true;
  603. TextSize = 30;
  604. BackgroundColor3 = rgb(255, 255, 255)
  605. }); library:apply_theme(items[ "title" ], "accent", "TextColor3");
  606.  
  607. items[ "multi_holder" ] = library:create( "Frame" , {
  608. Parent = items[ "main" ];
  609. Name = "\0";
  610. BackgroundTransparency = 1;
  611. Position = dim2(0, 196, 0, 0);
  612. BorderColor3 = rgb(0, 0, 0);
  613. Size = dim2(1, -196, 0, 56);
  614. BorderSizePixel = 0;
  615. BackgroundColor3 = rgb(255, 255, 255)
  616. }); cfg.multi_holder = items[ "multi_holder" ];
  617.  
  618. library:create( "Frame" , {
  619. AnchorPoint = vec2(0, 1);
  620. Parent = items[ "multi_holder" ];
  621. Position = dim2(0, 0, 1, 0);
  622. BorderColor3 = rgb(0, 0, 0);
  623. Size = dim2(1, 0, 0, 1);
  624. BorderSizePixel = 0;
  625. BackgroundColor3 = rgb(21, 21, 23)
  626. });
  627.  
  628. items[ "shadow" ] = library:create( "ImageLabel" , {
  629. ImageColor3 = rgb(0, 0, 0);
  630. ScaleType = Enum.ScaleType.Slice;
  631. Parent = items[ "main" ];
  632. BorderColor3 = rgb(0, 0, 0);
  633. Name = "\0";
  634. BackgroundColor3 = rgb(255, 255, 255);
  635. Size = dim2(1, 75, 1, 75);
  636. AnchorPoint = vec2(0.5, 0.5);
  637. Image = "rbxassetid://112971167999062";
  638. BackgroundTransparency = 1;
  639. Position = dim2(0.5, 0, 0.5, 0);
  640. SliceScale = 0.75;
  641. ZIndex = -100;
  642. BorderSizePixel = 0;
  643. SliceCenter = rect(vec2(112, 112), vec2(147, 147))
  644. });
  645.  
  646. items[ "global_fade" ] = library:create( "Frame" , {
  647. Parent = items[ "main" ];
  648. Name = "\0";
  649. BackgroundTransparency = 1;
  650. Position = dim2(0, 196, 0, 56);
  651. BorderColor3 = rgb(0, 0, 0);
  652. Size = dim2(1, -196, 1, -81);
  653. BorderSizePixel = 0;
  654. BackgroundColor3 = rgb(14, 14, 16);
  655. ZIndex = 2;
  656. });
  657.  
  658. library:create( "UICorner" , {
  659. Parent = items[ "shadow" ];
  660. CornerRadius = dim(0, 5)
  661. });
  662.  
  663. items[ "info" ] = library:create( "Frame" , {
  664. AnchorPoint = vec2(0, 1);
  665. Parent = items[ "main" ];
  666. Name = "\0";
  667. Position = dim2(0, 0, 1, 0);
  668. BorderColor3 = rgb(0, 0, 0);
  669. Size = dim2(1, 0, 0, 25);
  670. BorderSizePixel = 0;
  671. BackgroundColor3 = rgb(23, 23, 25)
  672. });
  673.  
  674. library:create( "UICorner" , {
  675. Parent = items[ "info" ];
  676. CornerRadius = dim(0, 10)
  677. });
  678.  
  679. items[ "grey_fill" ] = library:create( "Frame" , {
  680. Name = "\0";
  681. Parent = items[ "info" ];
  682. BorderColor3 = rgb(0, 0, 0);
  683. Size = dim2(1, 0, 0, 6);
  684. BorderSizePixel = 0;
  685. BackgroundColor3 = rgb(23, 23, 25)
  686. });
  687.  
  688. items[ "game" ] = library:create( "TextLabel" , {
  689. FontFace = fonts.font;
  690. Parent = items[ "info" ];
  691. TextColor3 = rgb(72, 72, 73);
  692. BorderColor3 = rgb(0, 0, 0);
  693. Text = cfg.game_name;
  694. Name = "\0";
  695. Size = dim2(1, 0, 0, 0);
  696. AnchorPoint = vec2(0, 0.5);
  697. Position = dim2(0, 10, 0.5, -1);
  698. BackgroundTransparency = 1;
  699. TextXAlignment = Enum.TextXAlignment.Left;
  700. BorderSizePixel = 0;
  701. AutomaticSize = Enum.AutomaticSize.XY;
  702. TextSize = 14;
  703. BackgroundColor3 = rgb(255, 255, 255)
  704. });
  705.  
  706. items[ "other_info" ] = library:create( "TextLabel" , {
  707. Parent = items[ "info" ];
  708. RichText = true;
  709. Name = "\0";
  710. TextColor3 = themes.preset.accent;
  711. BorderColor3 = rgb(0, 0, 0);
  712. Text = '<font color="rgb(72, 72, 73)">32 days left, </font>' .. cfg.name .. cfg.suffix;
  713. Size = dim2(1, 0, 0, 0);
  714. Position = dim2(0, -10, 0.5, -1);
  715. AnchorPoint = vec2(0, 0.5);
  716. BorderSizePixel = 0;
  717. BackgroundTransparency = 1;
  718. TextXAlignment = Enum.TextXAlignment.Right;
  719. AutomaticSize = Enum.AutomaticSize.XY;
  720. FontFace = fonts.font;
  721. TextSize = 14;
  722. BackgroundColor3 = rgb(255, 255, 255)
  723. }); library:apply_theme(items[ "other_info" ], "accent", "TextColor3");
  724. end
  725.  
  726. do -- Other
  727. library:draggify(items[ "main" ])
  728. library:resizify(items[ "main" ])
  729. end
  730.  
  731. function cfg.toggle_menu(bool)
  732. -- WIP
  733. -- if cfg.tween then
  734. -- cfg.tween:Cancel()
  735. -- end
  736.  
  737. -- items[ "main" ].Size = dim2(items[ "main" ].Size.Scale.X, items[ "main" ].Size.Offset.X - 20, items[ "main" ].Size.Scale.Y, items[ "main" ].Size.Offset.Y - 20)
  738. -- library:tween(items[ "tab_holder" ], {Size = dim2(1, -196, 1, -81)}, Enum.EasingStyle.Quad, 0.4)
  739. -- cfg.tween =
  740.  
  741. library[ "items" ].Enabled = bool
  742. end
  743.  
  744. return setmetatable(cfg, library)
  745. end
  746.  
  747. function library:tab(properties)
  748. local cfg = {
  749. name = properties.name or properties.Name or "visuals";
  750. icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6034767608";;
  751.  
  752. -- multi
  753. tabs = properties.tabs or properties.Tabs or {"Main", "Misc.", "Settings"};
  754. pages = {}; -- data store for multi sections
  755. current_multi;
  756.  
  757. items = {};
  758. }
  759.  
  760. local items = cfg.items; do
  761. items[ "tab_holder" ] = library:create( "Frame" , {
  762. Parent = library.cache;
  763. Name = "\0";
  764. Visible = false;
  765. BackgroundTransparency = 1;
  766. Position = dim2(0, 196, 0, 56);
  767. BorderColor3 = rgb(0, 0, 0);
  768. Size = dim2(1, -216, 1, -101);
  769. BorderSizePixel = 0;
  770. BackgroundColor3 = rgb(255, 255, 255)
  771. });
  772.  
  773. -- Tab buttons
  774. items[ "button" ] = library:create( "TextButton" , {
  775. FontFace = fonts.font;
  776. TextColor3 = rgb(255, 255, 255);
  777. BorderColor3 = rgb(0, 0, 0);
  778. Text = "";
  779. Parent = self.items[ "button_holder" ];
  780. AutoButtonColor = false;
  781. BackgroundTransparency = 1;
  782. Name = "\0";
  783. Size = dim2(1, 0, 0, 35);
  784. BorderSizePixel = 0;
  785. TextSize = 16;
  786. BackgroundColor3 = rgb(29, 29, 29)
  787. });
  788.  
  789. items[ "icon" ] = library:create( "ImageLabel" , {
  790. ImageColor3 = rgb(72, 72, 73);
  791. BorderColor3 = rgb(0, 0, 0);
  792. Parent = items[ "button" ];
  793. AnchorPoint = vec2(0, 0.5);
  794. BackgroundTransparency = 1;
  795. Position = dim2(0, 10, 0.5, 0);
  796. Name = "\0";
  797. Size = dim2(0, 22, 0, 22);
  798. BorderSizePixel = 0;
  799. BackgroundColor3 = rgb(255, 255, 255)
  800. }); library:apply_theme(items[ "icon" ], "accent", "ImageColor3");
  801.  
  802. items[ "name" ] = library:create( "TextLabel" , {
  803. FontFace = fonts.font;
  804. TextColor3 = rgb(72, 72, 73);
  805. BorderColor3 = rgb(0, 0, 0);
  806. Text = cfg.name;
  807. Parent = items[ "button" ];
  808. Name = "\0";
  809. Size = dim2(0, 0, 1, 0);
  810. Position = dim2(0, 40, 0, 0);
  811. BackgroundTransparency = 1;
  812. TextXAlignment = Enum.TextXAlignment.Left;
  813. BorderSizePixel = 0;
  814. AutomaticSize = Enum.AutomaticSize.X;
  815. TextSize = 16;
  816. BackgroundColor3 = rgb(255, 255, 255)
  817. });
  818.  
  819. library:create( "UIPadding" , {
  820. Parent = items[ "name" ];
  821. PaddingRight = dim(0, 5);
  822. PaddingLeft = dim(0, 5)
  823. });
  824.  
  825. library:create( "UICorner" , {
  826. Parent = items[ "button" ];
  827. CornerRadius = dim(0, 7)
  828. });
  829.  
  830. library:create( "UIStroke" , {
  831. Color = rgb(23, 23, 29);
  832. Parent = items[ "button" ];
  833. Enabled = false;
  834. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  835. });
  836. --
  837.  
  838. -- Multi Sections
  839. items[ "multi_section_button_holder" ] = library:create( "Frame" , {
  840. Parent = library.cache;
  841. BackgroundTransparency = 1;
  842. Name = "\0";
  843. Visible = false;
  844. BorderColor3 = rgb(0, 0, 0);
  845. Size = dim2(1, 0, 1, 0);
  846. BorderSizePixel = 0;
  847. BackgroundColor3 = rgb(255, 255, 255)
  848. });
  849.  
  850. library:create( "UIListLayout" , {
  851. Parent = items[ "multi_section_button_holder" ];
  852. Padding = dim(0, 7);
  853. SortOrder = Enum.SortOrder.LayoutOrder;
  854. FillDirection = Enum.FillDirection.Horizontal
  855. });
  856.  
  857. library:create( "UIPadding" , {
  858. PaddingTop = dim(0, 8);
  859. PaddingBottom = dim(0, 7);
  860. Parent = items[ "multi_section_button_holder" ];
  861. PaddingRight = dim(0, 7);
  862. PaddingLeft = dim(0, 7)
  863. });
  864.  
  865. for _, section in cfg.tabs do
  866. local data = {items = {}}
  867.  
  868. local multi_items = data.items; do
  869. -- Button
  870. multi_items[ "button" ] = library:create( "TextButton" , {
  871. FontFace = fonts.font;
  872. TextColor3 = rgb(255, 255, 255);
  873. BorderColor3 = rgb(0, 0, 0);
  874. AutoButtonColor = false;
  875. Text = "";
  876. Parent = items[ "multi_section_button_holder" ];
  877. Name = "\0";
  878. Size = dim2(0, 0, 0, 39);
  879. BackgroundTransparency = 1;
  880. ClipsDescendants = true;
  881. BorderSizePixel = 0;
  882. AutomaticSize = Enum.AutomaticSize.X;
  883. TextSize = 16;
  884. BackgroundColor3 = rgb(25, 25, 29)
  885. });
  886.  
  887. multi_items[ "name" ] = library:create( "TextLabel" , {
  888. FontFace = fonts.font;
  889. TextColor3 = rgb(62, 62, 63);
  890. BorderColor3 = rgb(0, 0, 0);
  891. Text = section;
  892. Parent = multi_items[ "button" ];
  893. Name = "\0";
  894. Size = dim2(0, 0, 1, 0);
  895. BackgroundTransparency = 1;
  896. TextXAlignment = Enum.TextXAlignment.Left;
  897. BorderSizePixel = 0;
  898. AutomaticSize = Enum.AutomaticSize.XY;
  899. TextSize = 16;
  900. BackgroundColor3 = rgb(255, 255, 255)
  901. });
  902.  
  903. library:create( "UIPadding" , {
  904. Parent = multi_items[ "name" ];
  905. PaddingRight = dim(0, 5);
  906. PaddingLeft = dim(0, 5)
  907. });
  908.  
  909. multi_items[ "accent" ] = library:create( "Frame" , {
  910. BorderColor3 = rgb(0, 0, 0);
  911. AnchorPoint = vec2(0, 1);
  912. Parent = multi_items[ "button" ];
  913. BackgroundTransparency = 1;
  914. Position = dim2(0, 10, 1, 4);
  915. Name = "\0";
  916. Size = dim2(1, -20, 0, 6);
  917. BorderSizePixel = 0;
  918. BackgroundColor3 = themes.preset.accent
  919. }); library:apply_theme(multi_items[ "accent" ], "accent", "BackgroundColor3");
  920.  
  921. library:create( "UICorner" , {
  922. Parent = multi_items[ "accent" ];
  923. CornerRadius = dim(0, 999)
  924. });
  925.  
  926. library:create( "UIPadding" , {
  927. Parent = multi_items[ "button" ];
  928. PaddingRight = dim(0, 10);
  929. PaddingLeft = dim(0, 10)
  930. });
  931.  
  932. library:create( "UICorner" , {
  933. Parent = multi_items[ "button" ];
  934. CornerRadius = dim(0, 7)
  935. });
  936. --
  937.  
  938. -- Tab
  939. multi_items[ "tab" ] = library:create( "Frame" , {
  940. Parent = library.cache;
  941. BackgroundTransparency = 1;
  942. Name = "\0";
  943. BorderColor3 = rgb(0, 0, 0);
  944. Size = dim2(1, -20, 1, -20);
  945. BorderSizePixel = 0;
  946. Visible = false;
  947. BackgroundColor3 = rgb(255, 255, 255)
  948. });
  949.  
  950. library:create( "UIListLayout" , {
  951. FillDirection = Enum.FillDirection.Vertical;
  952. HorizontalFlex = Enum.UIFlexAlignment.Fill;
  953. Parent = multi_items[ "tab" ];
  954. Padding = dim(0, 7);
  955. SortOrder = Enum.SortOrder.LayoutOrder;
  956. VerticalFlex = Enum.UIFlexAlignment.Fill
  957. });
  958.  
  959. library:create( "UIPadding" , {
  960. PaddingTop = dim(0, 7);
  961. PaddingBottom = dim(0, 7);
  962. Parent = multi_items[ "tab" ];
  963. PaddingRight = dim(0, 7);
  964. PaddingLeft = dim(0, 7)
  965. });
  966. --
  967. end
  968.  
  969. data.text = multi_items[ "name" ]
  970. data.accent = multi_items[ "accent" ]
  971. data.button = multi_items[ "button" ]
  972. data.page = multi_items[ "tab" ]
  973. data.parent = setmetatable(data, library):sub_tab({}).items[ "tab_parent" ]
  974.  
  975. -- Old column code
  976. -- data.left = multi_items[ "left" ]
  977. -- data.right = multi_items[ "right" ]
  978.  
  979. function data.open_page()
  980. local page = cfg.current_multi;
  981.  
  982. if page and page.text ~= data.text then
  983. self.items[ "global_fade" ].BackgroundTransparency = 0
  984. library:tween(self.items[ "global_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4)
  985.  
  986. local old_size = page.page.Size
  987. page.page.Size = dim2(1, -20, 1, -20)
  988. end
  989.  
  990. if page then
  991. library:tween(page.text, {TextColor3 = rgb(62, 62, 63)})
  992. library:tween(page.accent, {BackgroundTransparency = 1})
  993. library:tween(page.button, {BackgroundTransparency = 1})
  994.  
  995. page.page.Visible = false
  996. page.page.Parent = library[ "cache" ]
  997. end
  998.  
  999. library:tween(data.text, {TextColor3 = rgb(255, 255, 255)})
  1000. library:tween(data.accent, {BackgroundTransparency = 0})
  1001. library:tween(data.button, {BackgroundTransparency = 0})
  1002. library:tween(data.page, {Size = dim2(1, 0, 1, 0)}, Enum.EasingStyle.Quad, 0.4)
  1003.  
  1004. data.page.Visible = true
  1005. data.page.Parent = items["tab_holder"]
  1006.  
  1007. cfg.current_multi = data
  1008.  
  1009. library:close_element()
  1010. end
  1011.  
  1012. multi_items[ "button" ].MouseButton1Down:Connect(function()
  1013. data.open_page()
  1014. end)
  1015.  
  1016. cfg.pages[#cfg.pages + 1] = setmetatable(data, library)
  1017. end
  1018.  
  1019. cfg.pages[1].open_page()
  1020. --
  1021. end
  1022.  
  1023. function cfg.open_tab()
  1024. local selected_tab = self.selected_tab
  1025.  
  1026. if selected_tab then
  1027. if selected_tab[ 4 ] ~= items[ "tab_holder" ] then
  1028. self.items[ "global_fade" ].BackgroundTransparency = 0
  1029.  
  1030. library:tween(self.items[ "global_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4)
  1031. selected_tab[ 4 ].Size = dim2(1, -216, 1, -101)
  1032. end
  1033.  
  1034. library:tween(selected_tab[ 1 ], {BackgroundTransparency = 1})
  1035. library:tween(selected_tab[ 2 ], {ImageColor3 = rgb(72, 72, 73)})
  1036. library:tween(selected_tab[ 3 ], {TextColor3 = rgb(72, 72, 73)})
  1037.  
  1038. selected_tab[ 4 ].Visible = false
  1039. selected_tab[ 4 ].Parent = library[ "cache" ]
  1040. selected_tab[ 5 ].Visible = false
  1041. selected_tab[ 5 ].Parent = library[ "cache" ]
  1042. end
  1043.  
  1044. library:tween(items[ "button" ], {BackgroundTransparency = 0})
  1045. library:tween(items[ "icon" ], {ImageColor3 = themes.preset.accent})
  1046. library:tween(items[ "name" ], {TextColor3 = rgb(255, 255, 255)})
  1047. library:tween(items[ "tab_holder" ], {Size = dim2(1, -196, 1, -81)}, Enum.EasingStyle.Quad, 0.4)
  1048.  
  1049. items[ "tab_holder" ].Visible = true
  1050. items[ "tab_holder" ].Parent = self.items[ "main" ]
  1051. items[ "multi_section_button_holder" ].Visible = true
  1052. items[ "multi_section_button_holder" ].Parent = self.items[ "multi_holder" ]
  1053.  
  1054. self.selected_tab = {
  1055. items[ "button" ];
  1056. items[ "icon" ];
  1057. items[ "name" ];
  1058. items[ "tab_holder" ];
  1059. items[ "multi_section_button_holder" ];
  1060. }
  1061.  
  1062. library:close_element()
  1063. end
  1064.  
  1065. items[ "button" ].MouseButton1Down:Connect(function()
  1066. cfg.open_tab()
  1067. end)
  1068.  
  1069. if not self.selected_tab then
  1070. cfg.open_tab(true)
  1071. end
  1072.  
  1073. return unpack(cfg.pages)
  1074. end
  1075.  
  1076. function library:seperator(properties)
  1077. local cfg = {items = {}, name = properties.Name or properties.name or "General"}
  1078.  
  1079. local items = cfg.items do
  1080. items[ "name" ] = library:create( "TextLabel" , {
  1081. FontFace = fonts.font;
  1082. TextColor3 = rgb(72, 72, 73);
  1083. BorderColor3 = rgb(0, 0, 0);
  1084. Text = cfg.name;
  1085. Parent = self.items[ "button_holder" ];
  1086. Name = "\0";
  1087. Size = dim2(1, 0, 0, 0);
  1088. Position = dim2(0, 40, 0, 0);
  1089. BackgroundTransparency = 1;
  1090. TextXAlignment = Enum.TextXAlignment.Left;
  1091. BorderSizePixel = 0;
  1092. AutomaticSize = Enum.AutomaticSize.XY;
  1093. TextSize = 16;
  1094. BackgroundColor3 = rgb(255, 255, 255)
  1095. });
  1096.  
  1097. library:create( "UIPadding" , {
  1098. Parent = items[ "name" ];
  1099. PaddingRight = dim(0, 5);
  1100. PaddingLeft = dim(0, 5)
  1101. });
  1102. end;
  1103.  
  1104. return setmetatable(cfg, library)
  1105. end
  1106.  
  1107. -- Miscellaneous
  1108. function library:column(properties)
  1109. local cfg = {items = {}, size = properties.size or 1}
  1110.  
  1111. local items = cfg.items; do
  1112. items[ "column" ] = library:create( "Frame" , {
  1113. Parent = self[ "parent" ] or self.items["tab_parent"];
  1114. BackgroundTransparency = 1;
  1115. Name = "\0";
  1116. BorderColor3 = rgb(0, 0, 0);
  1117. Size = dim2(0, 0, cfg.size, 0);
  1118. BorderSizePixel = 0;
  1119. BackgroundColor3 = rgb(255, 255, 255)
  1120. });
  1121.  
  1122. library:create( "UIPadding" , {
  1123. PaddingBottom = dim(0, 10);
  1124. Parent = items[ "column" ]
  1125. });
  1126.  
  1127. library:create( "UIListLayout" , {
  1128. Parent = items[ "column" ];
  1129. HorizontalFlex = Enum.UIFlexAlignment.Fill;
  1130. Padding = dim(0, 10);
  1131. FillDirection = Enum.FillDirection.Vertical;
  1132. SortOrder = Enum.SortOrder.LayoutOrder
  1133. });
  1134. end
  1135.  
  1136. return setmetatable(cfg, library)
  1137. end
  1138.  
  1139. function library:sub_tab(properties)
  1140. local cfg = {items = {}, order = properties.order or 0; size = properties.size or 1}
  1141.  
  1142. local items = cfg.items; do
  1143. items[ "tab_parent" ] = library:create( "Frame" , {
  1144. Parent = self.items[ "tab" ];
  1145. BackgroundTransparency = 1;
  1146. Name = "\0";
  1147. Size = dim2(0,0,cfg.size,0);
  1148. BorderColor3 = rgb(0, 0, 0);
  1149. BorderSizePixel = 0;
  1150. Visible = true;
  1151. BackgroundColor3 = rgb(255, 255, 255)
  1152. });
  1153.  
  1154. library:create( "UIListLayout" , {
  1155. FillDirection = Enum.FillDirection.Horizontal;
  1156. HorizontalFlex = Enum.UIFlexAlignment.Fill;
  1157. VerticalFlex = Enum.UIFlexAlignment.Fill;
  1158. Parent = items[ "tab_parent" ];
  1159. Padding = dim(0, 7);
  1160. SortOrder = Enum.SortOrder.LayoutOrder;
  1161. });
  1162. end
  1163.  
  1164. return setmetatable(cfg, library)
  1165. end
  1166. --
  1167.  
  1168. function library:section(properties)
  1169. local cfg = {
  1170. name = properties.name or properties.Name or "section";
  1171. side = properties.side or properties.Side or "left";
  1172. default = properties.default or properties.Default or false;
  1173. size = properties.size or properties.Size or self.size or 0.5;
  1174. icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6022668898";;
  1175. fading_toggle = properties.fading or properties.Fading or false;
  1176. items = {};
  1177. };
  1178.  
  1179. local items = cfg.items; do
  1180. items[ "outline" ] = library:create( "Frame" , {
  1181. Name = "\0";
  1182. Parent = self.items[ "column" ];
  1183. BorderColor3 = rgb(0, 0, 0);
  1184. Size = dim2(1, 0, 0, 0);
  1185. AutomaticSize = Enum.AutomaticSize.Y;
  1186. BorderSizePixel = 0;
  1187. BackgroundColor3 = rgb(25, 25, 29)
  1188. });
  1189.  
  1190. library:create( "UICorner" , {
  1191. Parent = items[ "outline" ];
  1192. CornerRadius = dim(0, 7)
  1193. });
  1194.  
  1195. items[ "inline" ] = library:create( "Frame" , {
  1196. Parent = items[ "outline" ];
  1197. Name = "\0";
  1198. Position = dim2(0, 1, 0, 1);
  1199. BorderColor3 = rgb(0, 0, 0);
  1200. Size = dim2(1, -2, 0, 0);
  1201. AutomaticSize = Enum.AutomaticSize.Y;
  1202. BorderSizePixel = 0;
  1203. BackgroundColor3 = rgb(22, 22, 24)
  1204. });
  1205.  
  1206. library:create( "UICorner" , {
  1207. Parent = items[ "inline" ];
  1208. CornerRadius = dim(0, 7)
  1209. });
  1210.  
  1211. items[ "scrolling" ] = library:create( "ScrollingFrame" , {
  1212. ScrollBarImageColor3 = rgb(44, 44, 46);
  1213. Active = true;
  1214. AutomaticCanvasSize = Enum.AutomaticSize.Y;
  1215. ScrollBarThickness = 2;
  1216. Parent = items[ "inline" ];
  1217. Name = "\0";
  1218. Size = dim2(1, 0, 1, -40);
  1219. BackgroundTransparency = 1;
  1220. Position = dim2(0, 0, 0, 35);
  1221. BackgroundColor3 = rgb(255, 255, 255);
  1222. BorderColor3 = rgb(0, 0, 0);
  1223. BorderSizePixel = 0;
  1224. CanvasSize = dim2(0, 0, 0, 0)
  1225. });
  1226.  
  1227. items[ "elements" ] = library:create( "Frame" , {
  1228. BorderColor3 = rgb(0, 0, 0);
  1229. Parent = items[ "scrolling" ];
  1230. Name = "\0";
  1231. BackgroundTransparency = 1;
  1232. Position = dim2(0, 10, 0, 10);
  1233. Size = dim2(1, -20, 0, 0);
  1234. BorderSizePixel = 0;
  1235. AutomaticSize = Enum.AutomaticSize.Y;
  1236. BackgroundColor3 = rgb(255, 255, 255)
  1237. });
  1238.  
  1239. library:create( "UIListLayout" , {
  1240. Parent = items[ "elements" ];
  1241. Padding = dim(0, 10);
  1242. SortOrder = Enum.SortOrder.LayoutOrder
  1243. });
  1244.  
  1245. library:create( "UIPadding" , {
  1246. PaddingBottom = dim(0, 15);
  1247. Parent = items[ "elements" ]
  1248. });
  1249.  
  1250. items[ "button" ] = library:create( "TextButton" , {
  1251. FontFace = fonts.font;
  1252. TextColor3 = rgb(255, 255, 255);
  1253. BorderColor3 = rgb(0, 0, 0);
  1254. Text = "";
  1255. AutoButtonColor = false;
  1256. Parent = items[ "outline" ];
  1257. Name = "\0";
  1258. Position = dim2(0, 1, 0, 1);
  1259. Size = dim2(1, -2, 0, 35);
  1260. BorderSizePixel = 0;
  1261. TextSize = 16;
  1262. BackgroundColor3 = rgb(19, 19, 21)
  1263. });
  1264.  
  1265. library:create( "UIStroke" , {
  1266. Color = rgb(23, 23, 29);
  1267. Parent = items[ "button" ];
  1268. Enabled = false;
  1269. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  1270. });
  1271.  
  1272. library:create( "UICorner" , {
  1273. Parent = items[ "button" ];
  1274. CornerRadius = dim(0, 7)
  1275. });
  1276.  
  1277. items[ "Icon" ] = library:create( "ImageLabel" , {
  1278. ImageColor3 = themes.preset.accent;
  1279. BorderColor3 = rgb(0, 0, 0);
  1280. Parent = items[ "button" ];
  1281. AnchorPoint = vec2(0, 0.5);
  1282. Image = cfg.icon;
  1283. BackgroundTransparency = 1;
  1284. Position = dim2(0, 10, 0.5, 0);
  1285. Name = "\0";
  1286. Size = dim2(0, 22, 0, 22);
  1287. BorderSizePixel = 0;
  1288. BackgroundColor3 = rgb(255, 255, 255)
  1289. }); library:apply_theme(items[ "Icon" ], "accent", "ImageColor3");
  1290.  
  1291. items[ "section_title" ] = library:create( "TextLabel" , {
  1292. FontFace = fonts.font;
  1293. TextColor3 = rgb(255, 255, 255);
  1294. BorderColor3 = rgb(0, 0, 0);
  1295. Text = cfg.name;
  1296. Parent = items[ "button" ];
  1297. Name = "\0";
  1298. Size = dim2(0, 0, 1, 0);
  1299. Position = dim2(0, 40, 0, -1);
  1300. BackgroundTransparency = 1;
  1301. TextXAlignment = Enum.TextXAlignment.Left;
  1302. BorderSizePixel = 0;
  1303. AutomaticSize = Enum.AutomaticSize.X;
  1304. TextSize = 16;
  1305. BackgroundColor3 = rgb(255, 255, 255)
  1306. });
  1307.  
  1308. library:create( "Frame" , {
  1309. AnchorPoint = vec2(0, 1);
  1310. Parent = items[ "button" ];
  1311. Position = dim2(0, 0, 1, 0);
  1312. BorderColor3 = rgb(0, 0, 0);
  1313. Size = dim2(1, 0, 0, 1);
  1314. BorderSizePixel = 0;
  1315. BackgroundColor3 = rgb(36, 36, 37)
  1316. });
  1317.  
  1318. if cfg.fading_toggle then
  1319. items[ "toggle" ] = library:create( "TextButton" , {
  1320. FontFace = fonts.small;
  1321. TextColor3 = rgb(0, 0, 0);
  1322. BorderColor3 = rgb(0, 0, 0);
  1323. AutoButtonColor = false;
  1324. Text = "";
  1325. AnchorPoint = vec2(1, 0.5);
  1326. Parent = items[ "button" ];
  1327. Name = "\0";
  1328. Position = dim2(1, -9, 0.5, 0);
  1329. Size = dim2(0, 36, 0, 18);
  1330. BorderSizePixel = 0;
  1331. TextSize = 14;
  1332. BackgroundColor3 = rgb(58, 58, 62)
  1333. }); library:apply_theme(items[ "toggle" ], "accent", "BackgroundColor3");
  1334.  
  1335. library:create( "UICorner" , {
  1336. Parent = items[ "toggle" ];
  1337. CornerRadius = dim(0, 999)
  1338. });
  1339.  
  1340. items[ "toggle_outline" ] = library:create( "Frame" , {
  1341. Parent = items[ "toggle" ];
  1342. Size = dim2(1, -2, 1, -2);
  1343. Name = "\0";
  1344. BorderMode = Enum.BorderMode.Inset;
  1345. BorderColor3 = rgb(0, 0, 0);
  1346. Position = dim2(0, 1, 0, 1);
  1347. BorderSizePixel = 0;
  1348. BackgroundColor3 = rgb(50, 50, 50)
  1349. }); library:apply_theme(items[ "toggle_outline" ], "accent", "BackgroundColor3");
  1350.  
  1351. library:create( "UICorner" , {
  1352. Parent = items[ "toggle_outline" ];
  1353. CornerRadius = dim(0, 999)
  1354. });
  1355.  
  1356. library:create( "UIGradient" , {
  1357. Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))};
  1358. Parent = items[ "toggle_outline" ]
  1359. });
  1360.  
  1361. items[ "toggle_circle" ] = library:create( "Frame" , {
  1362. Parent = items[ "toggle_outline" ];
  1363. Name = "\0";
  1364. Position = dim2(0, 2, 0, 2);
  1365. BorderColor3 = rgb(0, 0, 0);
  1366. Size = dim2(0, 12, 0, 12);
  1367. BorderSizePixel = 0;
  1368. BackgroundColor3 = rgb(86, 86, 88)
  1369. });
  1370.  
  1371. library:create( "UICorner" , {
  1372. Parent = items[ "toggle_circle" ];
  1373. CornerRadius = dim(0, 999)
  1374. });
  1375.  
  1376. library:create( "UICorner" , {
  1377. Parent = items[ "outline" ];
  1378. CornerRadius = dim(0, 7)
  1379. });
  1380.  
  1381. items[ "fade" ] = library:create( "Frame" , {
  1382. Parent = items[ "outline" ];
  1383. BackgroundTransparency = 0.800000011920929;
  1384. Name = "\0";
  1385. BorderColor3 = rgb(0, 0, 0);
  1386. Size = dim2(1, 0, 1, 0);
  1387. BorderSizePixel = 0;
  1388. BackgroundColor3 = rgb(0, 0, 0)
  1389. });
  1390.  
  1391. library:create( "UICorner" , {
  1392. Parent = items[ "fade" ];
  1393. CornerRadius = dim(0, 7)
  1394. });
  1395. end
  1396. end;
  1397.  
  1398. if cfg.fading_toggle then
  1399. items[ "button" ].MouseButton1Click:Connect(function()
  1400. cfg.default = not cfg.default
  1401. cfg.toggle_section(cfg.default)
  1402. end)
  1403.  
  1404. function cfg.toggle_section(bool)
  1405. library:tween(items[ "toggle" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(58, 58, 62)}, Enum.EasingStyle.Quad)
  1406. library:tween(items[ "toggle_outline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(50, 50, 50)}, Enum.EasingStyle.Quad)
  1407. library:tween(items[ "toggle_circle" ], {BackgroundColor3 = bool and rgb(255, 255, 255) or rgb(86, 86, 88), Position = bool and dim2(1, -14, 0, 2) or dim2(0, 2, 0, 2)}, Enum.EasingStyle.Quad)
  1408. library:tween(items[ "fade" ], {BackgroundTransparency = bool and 1 or 0.8}, Enum.EasingStyle.Quad)
  1409. end
  1410. end
  1411.  
  1412. return setmetatable(cfg, library)
  1413. end
  1414.  
  1415.  
  1416. function library:tabbox(properties)
  1417. local cfg = {
  1418. name = properties.name or properties.Name or "Tabbox";
  1419. tabs = properties.tabs or properties.Tabs or {"Tab 1", "Tab 2"};
  1420. size = properties.size or properties.Size or self.size or 0.5;
  1421. icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6022668898";;
  1422. items = {};
  1423. pages = {};
  1424. current_tab = nil;
  1425. }
  1426.  
  1427. local items = cfg.items; do
  1428. items[ "outline" ] = library:create( "Frame" , {
  1429. Name = "\0";
  1430. Parent = self.items[ "column" ];
  1431. BorderColor3 = rgb(0, 0, 0);
  1432. Size = dim2(1, 0, 0, 0);
  1433. AutomaticSize = Enum.AutomaticSize.Y;
  1434. BorderSizePixel = 0;
  1435. BackgroundColor3 = rgb(25, 25, 29)
  1436. });
  1437.  
  1438. library:create( "UICorner" , {
  1439. Parent = items[ "outline" ];
  1440. CornerRadius = dim(0, 7)
  1441. });
  1442.  
  1443. items[ "inline" ] = library:create( "Frame" , {
  1444. Parent = items[ "outline" ];
  1445. Name = "\0";
  1446. Position = dim2(0, 1, 0, 1);
  1447. BorderColor3 = rgb(0, 0, 0);
  1448. Size = dim2(1, -2, 0, 0);
  1449. AutomaticSize = Enum.AutomaticSize.Y;
  1450. BorderSizePixel = 0;
  1451. BackgroundColor3 = rgb(22, 22, 24)
  1452. });
  1453.  
  1454. library:create( "UICorner" , {
  1455. Parent = items[ "inline" ];
  1456. CornerRadius = dim(0, 7)
  1457. });
  1458.  
  1459. items[ "tab_bar" ] = library:create( "Frame" , {
  1460. Parent = items[ "inline" ];
  1461. Name = "\0";
  1462. Position = dim2(0, 0, 0, 0);
  1463. BorderColor3 = rgb(0, 0, 0);
  1464. Size = dim2(1, 0, 0, 35);
  1465. BorderSizePixel = 0;
  1466. BackgroundColor3 = rgb(19, 19, 21)
  1467. });
  1468.  
  1469. library:create( "UICorner" , {
  1470. Parent = items[ "tab_bar" ];
  1471. CornerRadius = dim(0, 7)
  1472. });
  1473.  
  1474. library:create( "Frame" , {
  1475. AnchorPoint = vec2(0, 1);
  1476. Parent = items[ "tab_bar" ];
  1477. Position = dim2(0, 0, 1, 0);
  1478. BorderColor3 = rgb(0, 0, 0);
  1479. Size = dim2(1, 0, 0, 1);
  1480. BorderSizePixel = 0;
  1481. BackgroundColor3 = rgb(36, 36, 37)
  1482. });
  1483.  
  1484. items[ "content" ] = library:create( "Frame" , {
  1485. Parent = items[ "inline" ];
  1486. Name = "\0";
  1487. Position = dim2(0, 0, 0, 35);
  1488. BorderColor3 = rgb(0, 0, 0);
  1489. Size = dim2(1, 0, 0, 0);
  1490. AutomaticSize = Enum.AutomaticSize.Y;
  1491. BorderSizePixel = 0;
  1492. BackgroundTransparency = 1;
  1493. BackgroundColor3 = rgb(255, 255, 255)
  1494. });
  1495.  
  1496. local total_tabs = #cfg.tabs
  1497.  
  1498. for i = 1, total_tabs do
  1499. local tab_name = cfg.tabs[i]
  1500. local page = {items = {}}
  1501.  
  1502. local btn = library:create( "TextButton" , {
  1503. FontFace = fonts.font;
  1504. Text = "";
  1505. Parent = items[ "tab_bar" ];
  1506. AutoButtonColor = false;
  1507. Name = "\0";
  1508. BackgroundTransparency = 1;
  1509. Position = dim2((i - 1) / total_tabs, 0, 0, 0);
  1510. Size = dim2(1 / total_tabs, 0, 1, 0);
  1511. BorderSizePixel = 0;
  1512. TextSize = 14;
  1513. BackgroundColor3 = rgb(25, 25, 29)
  1514. });
  1515.  
  1516. local btn_label = library:create( "TextLabel" , {
  1517. FontFace = fonts.font;
  1518. TextColor3 = i == 1 and rgb(255, 255, 255) or rgb(62, 62, 63);
  1519. Text = tab_name;
  1520. Parent = btn;
  1521. Name = "\0";
  1522. Size = dim2(1, 0, 1, 0);
  1523. BackgroundTransparency = 1;
  1524. TextXAlignment = Enum.TextXAlignment.Center;
  1525. BorderSizePixel = 0;
  1526. TextSize = 14;
  1527. BackgroundColor3 = rgb(255, 255, 255)
  1528. });
  1529.  
  1530. local accent = library:create( "Frame" , {
  1531. AnchorPoint = vec2(0, 1);
  1532. Parent = btn;
  1533. Position = dim2(0, 4, 1, 0);
  1534. BorderColor3 = rgb(0, 0, 0);
  1535. Size = dim2(1, -8, 0, 3);
  1536. BorderSizePixel = 0;
  1537. BackgroundTransparency = i == 1 and 0 or 1;
  1538. BackgroundColor3 = themes.preset.accent
  1539. }); library:apply_theme(accent, "accent", "BackgroundColor3");
  1540.  
  1541. library:create( "UICorner" , {
  1542. Parent = accent;
  1543. CornerRadius = dim(0, 999)
  1544. });
  1545.  
  1546. local container = library:create( "Frame" , {
  1547. Parent = items[ "content" ];
  1548. Name = "\0";
  1549. Size = dim2(1, 0, 0, 0);
  1550. AutomaticSize = Enum.AutomaticSize.Y;
  1551. BackgroundTransparency = 1;
  1552. Position = dim2(0, 0, 0, 0);
  1553. BorderColor3 = rgb(0, 0, 0);
  1554. BorderSizePixel = 0;
  1555. Visible = i == 1;
  1556. BackgroundColor3 = rgb(255, 255, 255)
  1557. });
  1558.  
  1559. local elements = library:create( "Frame" , {
  1560. BorderColor3 = rgb(0, 0, 0);
  1561. Parent = container;
  1562. Name = "\0";
  1563. BackgroundTransparency = 1;
  1564. Position = dim2(0, 10, 0, 10);
  1565. Size = dim2(1, -20, 0, 0);
  1566. BorderSizePixel = 0;
  1567. AutomaticSize = Enum.AutomaticSize.Y;
  1568. BackgroundColor3 = rgb(255, 255, 255)
  1569. });
  1570.  
  1571. library:create( "UIListLayout" , {
  1572. Parent = elements;
  1573. Padding = dim(0, 10);
  1574. SortOrder = Enum.SortOrder.LayoutOrder
  1575. });
  1576.  
  1577. library:create( "UIPadding" , {
  1578. PaddingBottom = dim(0, 15);
  1579. Parent = elements
  1580. });
  1581.  
  1582. page.btn = btn
  1583. page.label = btn_label
  1584. page.accent = accent
  1585. page.scrolling = container
  1586. page.items[ "elements" ] = elements
  1587.  
  1588. local page_meta = setmetatable(page, library)
  1589. cfg.pages[#cfg.pages + 1] = page_meta
  1590.  
  1591. btn.MouseButton1Down:Connect(function()
  1592. for _, p in cfg.pages do
  1593. library:tween(p.label, {TextColor3 = rgb(62, 62, 63)})
  1594. library:tween(p.accent, {BackgroundTransparency = 1})
  1595. p.scrolling.Visible = false
  1596. end
  1597. library:tween(btn_label, {TextColor3 = rgb(255, 255, 255)})
  1598. library:tween(accent, {BackgroundTransparency = 0})
  1599. scrolling.Visible = true
  1600. cfg.current_tab = page_meta
  1601. end)
  1602. end
  1603. end
  1604.  
  1605. cfg.current_tab = cfg.pages[1]
  1606.  
  1607. return table.unpack(cfg.pages)
  1608. end
  1609. function library:toggle(options)
  1610. local rand = math.random(1, 2)
  1611. local cfg = {
  1612. enabled = options.enabled or nil,
  1613. name = options.name or "Toggle",
  1614. info = options.info or nil,
  1615. flag = options.flag or library:next_flag(),
  1616.  
  1617. type = options.type and string.lower(options.type) or rand == 1 and "toggle" or "checkbox"; -- "toggle", "checkbox"
  1618.  
  1619. default = options.default or false,
  1620. folding = options.folding or false,
  1621. callback = options.callback or function() end,
  1622.  
  1623. items = {};
  1624. seperator = options.seperator or options.Seperator or false;
  1625. }
  1626.  
  1627. flags[cfg.flag] = cfg.default
  1628.  
  1629. local items = cfg.items; do
  1630. items[ "toggle" ] = library:create( "TextButton" , {
  1631. FontFace = fonts.small;
  1632. TextColor3 = rgb(0, 0, 0);
  1633. BorderColor3 = rgb(0, 0, 0);
  1634. Text = "";
  1635. Parent = self.items[ "elements" ];
  1636. Name = "\0";
  1637. BackgroundTransparency = 1;
  1638. Size = dim2(1, 0, 0, 0);
  1639. BorderSizePixel = 0;
  1640. AutomaticSize = Enum.AutomaticSize.Y;
  1641. TextSize = 14;
  1642. BackgroundColor3 = rgb(255, 255, 255)
  1643. });
  1644.  
  1645. items[ "name" ] = library:create( "TextLabel" , {
  1646. FontFace = fonts.small;
  1647. TextColor3 = rgb(245, 245, 245);
  1648. BorderColor3 = rgb(0, 0, 0);
  1649. Text = cfg.name;
  1650. Parent = items[ "toggle" ];
  1651. Name = "\0";
  1652. Size = dim2(1, 0, 0, 0);
  1653. BackgroundTransparency = 1;
  1654. TextXAlignment = Enum.TextXAlignment.Left;
  1655. BorderSizePixel = 0;
  1656. AutomaticSize = Enum.AutomaticSize.XY;
  1657. TextSize = 16;
  1658. BackgroundColor3 = rgb(255, 255, 255)
  1659. });
  1660.  
  1661. if cfg.info then
  1662. items[ "info" ] = library:create( "TextLabel" , {
  1663. FontFace = fonts.small;
  1664. TextColor3 = rgb(130, 130, 130);
  1665. BorderColor3 = rgb(0, 0, 0);
  1666. TextWrapped = true;
  1667. Text = cfg.info;
  1668. Parent = items[ "toggle" ];
  1669. Name = "\0";
  1670. Position = dim2(0, 5, 0, 17);
  1671. Size = dim2(1, -10, 0, 0);
  1672. BackgroundTransparency = 1;
  1673. TextXAlignment = Enum.TextXAlignment.Left;
  1674. BorderSizePixel = 0;
  1675. AutomaticSize = Enum.AutomaticSize.XY;
  1676. TextSize = 16;
  1677. BackgroundColor3 = rgb(255, 255, 255)
  1678. });
  1679. end
  1680.  
  1681. library:create( "UIPadding" , {
  1682. Parent = items[ "name" ];
  1683. PaddingRight = dim(0, 5);
  1684. PaddingLeft = dim(0, 5)
  1685. });
  1686.  
  1687. items[ "right_components" ] = library:create( "Frame" , {
  1688. Parent = items[ "toggle" ];
  1689. Name = "\0";
  1690. Position = dim2(1, 0, 0, 0);
  1691. BorderColor3 = rgb(0, 0, 0);
  1692. Size = dim2(0, 0, 1, 0);
  1693. BorderSizePixel = 0;
  1694. BackgroundColor3 = rgb(255, 255, 255)
  1695. });
  1696.  
  1697. library:create( "UIListLayout" , {
  1698. FillDirection = Enum.FillDirection.Horizontal;
  1699. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  1700. Parent = items[ "right_components" ];
  1701. Padding = dim(0, 9);
  1702. SortOrder = Enum.SortOrder.LayoutOrder
  1703. });
  1704.  
  1705. -- Toggle
  1706. if cfg.type == "checkbox" then
  1707. items[ "toggle_button" ] = library:create( "TextButton" , {
  1708. FontFace = fonts.small;
  1709. TextColor3 = rgb(0, 0, 0);
  1710. BorderColor3 = rgb(0, 0, 0);
  1711. Text = "";
  1712. LayoutOrder = 2;
  1713. AutoButtonColor = false;
  1714. AnchorPoint = vec2(1, 0);
  1715. Parent = items[ "right_components" ];
  1716. Name = "\0";
  1717. Position = dim2(1, 0, 0, 0);
  1718. Size = dim2(0, 16, 0, 16);
  1719. BorderSizePixel = 0;
  1720. TextSize = 14;
  1721. BackgroundColor3 = rgb(67, 67, 68)
  1722. }); library:apply_theme(items[ "toggle_button" ], "accent", "BackgroundColor3");
  1723.  
  1724. library:create( "UICorner" , {
  1725. Parent = items[ "toggle_button" ];
  1726. CornerRadius = dim(0, 4)
  1727. });
  1728.  
  1729. items[ "outline" ] = library:create( "Frame" , {
  1730. Parent = items[ "toggle_button" ];
  1731. Size = dim2(1, -2, 1, -2);
  1732. Name = "\0";
  1733. BorderMode = Enum.BorderMode.Inset;
  1734. BorderColor3 = rgb(0, 0, 0);
  1735. Position = dim2(0, 1, 0, 1);
  1736. BorderSizePixel = 0;
  1737. BackgroundColor3 = rgb(22, 22, 24)
  1738. }); library:apply_theme(items[ "outline" ], "accent", "BackgroundColor3");
  1739.  
  1740. items[ "tick" ] = library:create( "ImageLabel" , {
  1741. ImageTransparency = 1;
  1742. BorderColor3 = rgb(0, 0, 0);
  1743. Image = "rbxassetid://111862698467575";
  1744. BackgroundTransparency = 1;
  1745. Position = dim2(0, -1, 0, 0);
  1746. Parent = items[ "outline" ];
  1747. Size = dim2(1, 2, 1, 2);
  1748. BorderSizePixel = 0;
  1749. BackgroundColor3 = rgb(255, 255, 255);
  1750. ZIndex = 1;
  1751. });
  1752.  
  1753. library:create( "UICorner" , {
  1754. Parent = items[ "outline" ];
  1755. CornerRadius = dim(0, 4)
  1756. });
  1757.  
  1758. library:create( "UIGradient" , {
  1759. Enabled = false;
  1760. Parent = items[ "outline" ];
  1761. Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))}
  1762. });
  1763. else
  1764. items[ "toggle_button" ] = library:create( "TextButton" , {
  1765. FontFace = fonts.font;
  1766. TextColor3 = rgb(0, 0, 0);
  1767. BorderColor3 = rgb(0, 0, 0);
  1768. Text = "";
  1769. LayoutOrder = 2;
  1770. AnchorPoint = vec2(1, 0.5);
  1771. Parent = items[ "right_components" ];
  1772. Name = "\0";
  1773. Position = dim2(1, -9, 0.5, 0);
  1774. Size = dim2(0, 36, 0, 18);
  1775. BorderSizePixel = 0;
  1776. TextSize = 14;
  1777. BackgroundColor3 = themes.preset.accent
  1778. }); library:apply_theme(items[ "toggle_button" ], "accent", "BackgroundColor3");
  1779.  
  1780. library:create( "UICorner" , {
  1781. Parent = items[ "toggle_button" ];
  1782. CornerRadius = dim(0, 999)
  1783. });
  1784.  
  1785. items[ "inline" ] = library:create( "Frame" , {
  1786. Parent = items[ "toggle_button" ];
  1787. Size = dim2(1, -2, 1, -2);
  1788. Name = "\0";
  1789. BorderMode = Enum.BorderMode.Inset;
  1790. BorderColor3 = rgb(0, 0, 0);
  1791. Position = dim2(0, 1, 0, 1);
  1792. BorderSizePixel = 0;
  1793. BackgroundColor3 = themes.preset.accent
  1794. }); library:apply_theme(items[ "inline" ], "accent", "BackgroundColor3");
  1795.  
  1796. library:create( "UICorner" , {
  1797. Parent = items[ "inline" ];
  1798. CornerRadius = dim(0, 999)
  1799. });
  1800.  
  1801. library:create( "UIGradient" , {
  1802. Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))};
  1803. Parent = items[ "inline" ]
  1804. });
  1805.  
  1806. items[ "circle" ] = library:create( "Frame" , {
  1807. Parent = items[ "inline" ];
  1808. Name = "\0";
  1809. Position = dim2(1, -14, 0, 2);
  1810. BorderColor3 = rgb(0, 0, 0);
  1811. Size = dim2(0, 12, 0, 12);
  1812. BorderSizePixel = 0;
  1813. BackgroundColor3 = rgb(255, 255, 255)
  1814. });
  1815.  
  1816. library:create( "UICorner" , {
  1817. Parent = items[ "circle" ];
  1818. CornerRadius = dim(0, 999)
  1819. });
  1820. end
  1821. --
  1822. end;
  1823.  
  1824. function cfg.set(bool)
  1825. if cfg.type == "checkbox" then
  1826. library:tween(items[ "tick" ], {Rotation = bool and 0 or 45, ImageTransparency = bool and 0 or 1})
  1827. library:tween(items[ "toggle_button" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(67, 67, 68)})
  1828. library:tween(items[ "outline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(22, 22, 24)})
  1829. else
  1830. library:tween(items[ "toggle_button" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(58, 58, 62)}, Enum.EasingStyle.Quad)
  1831. library:tween(items[ "inline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(50, 50, 50)}, Enum.EasingStyle.Quad)
  1832. library:tween(items[ "circle" ], {BackgroundColor3 = bool and rgb(255, 255, 255) or rgb(86, 86, 88), Position = bool and dim2(1, -14, 0, 2) or dim2(0, 2, 0, 2)}, Enum.EasingStyle.Quad)
  1833. end
  1834.  
  1835. cfg.callback(bool)
  1836.  
  1837. if cfg.folding then
  1838. elements.Visible = bool
  1839. end
  1840.  
  1841. flags[cfg.flag] = bool
  1842. end
  1843.  
  1844. items[ "toggle" ].MouseButton1Click:Connect(function()
  1845. cfg.enabled = not cfg.enabled
  1846. cfg.set(cfg.enabled)
  1847. end)
  1848.  
  1849. items[ "toggle_button" ].MouseButton1Click:Connect(function()
  1850. cfg.enabled = not cfg.enabled
  1851. cfg.set(cfg.enabled)
  1852. end)
  1853.  
  1854. if cfg.seperator then -- ok bro my lua either sucks or this was a pain in the ass to make (simple if statement aswell 💔)
  1855. library:create( "Frame" , {
  1856. AnchorPoint = vec2(0, 1);
  1857. Parent = self.items[ "elements" ];
  1858. Position = dim2(0, 0, 1, 0);
  1859. BorderColor3 = rgb(0, 0, 0);
  1860. Size = dim2(1, 1, 0, 1);
  1861. BorderSizePixel = 0;
  1862. BackgroundColor3 = rgb(36, 36, 37)
  1863. });
  1864. end
  1865.  
  1866. cfg.set(cfg.default)
  1867.  
  1868. config_flags[cfg.flag] = cfg.set
  1869.  
  1870. return setmetatable(cfg, library)
  1871. end
  1872.  
  1873. function library:slider(options)
  1874. local cfg = {
  1875. name = options.name or nil,
  1876. suffix = options.suffix or "",
  1877. flag = options.flag or library:next_flag(),
  1878. callback = options.callback or function() end,
  1879. info = options.info or nil;
  1880.  
  1881. -- value settings
  1882. min = options.min or options.minimum or 0,
  1883. max = options.max or options.maximum or 100,
  1884. intervals = options.interval or options.decimal or 1,
  1885. default = options.default or 10,
  1886. value = options.default or 10,
  1887. seperator = options.seperator or options.Seperator or true;
  1888.  
  1889. dragging = false,
  1890. items = {}
  1891. }
  1892.  
  1893. flags[cfg.flag] = cfg.default
  1894.  
  1895. local items = cfg.items; do
  1896. items[ "slider_object" ] = library:create( "TextButton" , {
  1897. FontFace = fonts.small;
  1898. TextColor3 = rgb(0, 0, 0);
  1899. BorderColor3 = rgb(0, 0, 0);
  1900. Text = "";
  1901. Parent = self.items[ "elements" ];
  1902. Name = "\0";
  1903. BackgroundTransparency = 1;
  1904. Size = dim2(1, 0, 0, 0);
  1905. BorderSizePixel = 0;
  1906. AutomaticSize = Enum.AutomaticSize.Y;
  1907. TextSize = 14;
  1908. BackgroundColor3 = rgb(255, 255, 255)
  1909. });
  1910.  
  1911. items[ "name" ] = library:create( "TextLabel" , {
  1912. FontFace = fonts.small;
  1913. TextColor3 = rgb(245, 245, 245);
  1914. BorderColor3 = rgb(0, 0, 0);
  1915. Text = cfg.name;
  1916. Parent = items[ "slider_object" ];
  1917. Name = "\0";
  1918. Size = dim2(1, 0, 0, 0);
  1919. BackgroundTransparency = 1;
  1920. TextXAlignment = Enum.TextXAlignment.Left;
  1921. BorderSizePixel = 0;
  1922. AutomaticSize = Enum.AutomaticSize.XY;
  1923. TextSize = 16;
  1924. BackgroundColor3 = rgb(255, 255, 255)
  1925. });
  1926.  
  1927. if cfg.info then
  1928. items[ "info" ] = library:create( "TextLabel" , {
  1929. FontFace = fonts.small;
  1930. TextColor3 = rgb(130, 130, 130);
  1931. BorderColor3 = rgb(0, 0, 0);
  1932. TextWrapped = true;
  1933. Text = cfg.info;
  1934. Parent = items[ "slider_object" ];
  1935. Name = "\0";
  1936. Position = dim2(0, 5, 0, 37);
  1937. Size = dim2(1, -10, 0, 0);
  1938. BackgroundTransparency = 1;
  1939. TextXAlignment = Enum.TextXAlignment.Left;
  1940. BorderSizePixel = 0;
  1941. AutomaticSize = Enum.AutomaticSize.XY;
  1942. TextSize = 16;
  1943. BackgroundColor3 = rgb(255, 255, 255)
  1944. });
  1945. end
  1946.  
  1947. library:create( "UIPadding" , {
  1948. Parent = items[ "name" ];
  1949. PaddingRight = dim(0, 5);
  1950. PaddingLeft = dim(0, 5)
  1951. });
  1952.  
  1953. items[ "right_components" ] = library:create( "Frame" , {
  1954. Parent = items[ "slider_object" ];
  1955. Name = "\0";
  1956. BackgroundTransparency = 1;
  1957. Position = dim2(0, 4, 0, 23);
  1958. BorderColor3 = rgb(0, 0, 0);
  1959. Size = dim2(1, 0, 0, 12);
  1960. BorderSizePixel = 0;
  1961. BackgroundColor3 = rgb(255, 255, 255)
  1962. });
  1963.  
  1964. library:create( "UIListLayout" , {
  1965. Parent = items[ "right_components" ];
  1966. Padding = dim(0, 7);
  1967. SortOrder = Enum.SortOrder.LayoutOrder;
  1968. FillDirection = Enum.FillDirection.Horizontal
  1969. });
  1970.  
  1971. items[ "slider" ] = library:create( "TextButton" , {
  1972. FontFace = fonts.small;
  1973. TextColor3 = rgb(0, 0, 0);
  1974. BorderColor3 = rgb(0, 0, 0);
  1975. Text = "";
  1976. AutoButtonColor = false;
  1977. AnchorPoint = vec2(1, 0);
  1978. Parent = items[ "right_components" ];
  1979. Name = "\0";
  1980. Position = dim2(1, 0, 0, 0);
  1981. Size = dim2(1, -4, 0, 4);
  1982. BorderSizePixel = 0;
  1983. TextSize = 14;
  1984. BackgroundColor3 = rgb(33, 33, 35)
  1985. });
  1986.  
  1987. library:create( "UICorner" , {
  1988. Parent = items[ "slider" ];
  1989. CornerRadius = dim(0, 999)
  1990. });
  1991.  
  1992. items[ "fill" ] = library:create( "Frame" , {
  1993. Name = "\0";
  1994. Parent = items[ "slider" ];
  1995. BorderColor3 = rgb(0, 0, 0);
  1996. Size = dim2(0.5, 0, 0, 4);
  1997. BorderSizePixel = 0;
  1998. BackgroundColor3 = themes.preset.accent
  1999. }); library:apply_theme(items[ "fill" ], "accent", "BackgroundColor3");
  2000.  
  2001. library:create( "UICorner" , {
  2002. Parent = items[ "fill" ];
  2003. CornerRadius = dim(0, 999)
  2004. });
  2005.  
  2006. items[ "circle" ] = library:create( "Frame" , {
  2007. AnchorPoint = vec2(0.5, 0.5);
  2008. Parent = items[ "fill" ];
  2009. Name = "\0";
  2010. Position = dim2(1, 0, 0.5, 0);
  2011. BorderColor3 = rgb(0, 0, 0);
  2012. Size = dim2(0, 12, 0, 12);
  2013. BorderSizePixel = 0;
  2014. BackgroundColor3 = rgb(244, 244, 244)
  2015. });
  2016.  
  2017. library:create( "UICorner" , {
  2018. Parent = items[ "circle" ];
  2019. CornerRadius = dim(0, 999)
  2020. });
  2021.  
  2022. library:create( "UIPadding" , {
  2023. Parent = items[ "right_components" ];
  2024. PaddingTop = dim(0, 4)
  2025. });
  2026.  
  2027. items[ "value" ] = library:create( "TextLabel" , {
  2028. FontFace = fonts.small;
  2029. TextColor3 = rgb(72, 72, 73);
  2030. BorderColor3 = rgb(0, 0, 0);
  2031. Text = "50%";
  2032. Parent = items[ "slider_object" ];
  2033. Name = "\0";
  2034. Size = dim2(1, 0, 0, 0);
  2035. Position = dim2(0, 6, 0, 0);
  2036. BackgroundTransparency = 1;
  2037. TextXAlignment = Enum.TextXAlignment.Right;
  2038. BorderSizePixel = 0;
  2039. AutomaticSize = Enum.AutomaticSize.XY;
  2040. TextSize = 16;
  2041. BackgroundColor3 = rgb(255, 255, 255)
  2042. });
  2043.  
  2044. library:create( "UIPadding" , {
  2045. Parent = items[ "value" ];
  2046. PaddingRight = dim(0, 5);
  2047. PaddingLeft = dim(0, 5)
  2048. });
  2049. end
  2050.  
  2051. function cfg.set(value)
  2052. cfg.value = clamp(library:round(value, cfg.intervals), cfg.min, cfg.max)
  2053.  
  2054. library:tween(items[ "fill" ], {Size = dim2((cfg.value - cfg.min) / (cfg.max - cfg.min), cfg.value == cfg.min and 0 or -4, 0, 2)}, Enum.EasingStyle.Linear, 0.05)
  2055. items[ "value" ].Text = tostring(cfg.value) .. cfg.suffix
  2056.  
  2057. flags[cfg.flag] = cfg.value
  2058. cfg.callback(flags[cfg.flag])
  2059. end
  2060.  
  2061. items[ "slider" ].MouseButton1Down:Connect(function()
  2062. cfg.dragging = true
  2063. library:tween(items[ "value" ], {TextColor3 = rgb(255, 255, 255)}, Enum.EasingStyle.Quad, 0.2)
  2064. end)
  2065.  
  2066. library:connection(uis.InputChanged, function(input)
  2067. if cfg.dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  2068. local size_x = (input.Position.X - items[ "slider" ].AbsolutePosition.X) / items[ "slider" ].AbsoluteSize.X
  2069. local value = ((cfg.max - cfg.min) * size_x) + cfg.min
  2070. cfg.set(value)
  2071. end
  2072. end)
  2073.  
  2074. library:connection(uis.InputEnded, function(input)
  2075. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2076. cfg.dragging = false
  2077. library:tween(items[ "value" ], {TextColor3 = rgb(72, 72, 73)}, Enum.EasingStyle.Quad, 0.2)
  2078. end
  2079. end)
  2080.  
  2081. if cfg.seperator then
  2082. library:create( "Frame" , {
  2083. AnchorPoint = vec2(0, 1);
  2084. Parent = self.items[ "elements" ];
  2085. Position = dim2(0, 0, 1, 0);
  2086. BorderColor3 = rgb(0, 0, 0);
  2087. Size = dim2(1, 1, 0, 1);
  2088. BorderSizePixel = 0;
  2089. BackgroundColor3 = rgb(36, 36, 37)
  2090. });
  2091. end
  2092.  
  2093. cfg.set(cfg.default)
  2094. config_flags[cfg.flag] = cfg.set
  2095.  
  2096. return setmetatable(cfg, library)
  2097. end
  2098.  
  2099. function library:dropdown(options)
  2100. local cfg = {
  2101. name = options.name or nil;
  2102. info = options.info or nil;
  2103. flag = options.flag or library:next_flag();
  2104. options = options.items or {""};
  2105. callback = options.callback or function() end;
  2106. multi = options.multi or false;
  2107. scrolling = options.scrolling or false;
  2108. search = options.search or options.searchable or false;
  2109. large = options.large or false;
  2110.  
  2111. width = options.width or 130;
  2112.  
  2113. -- Ignore these
  2114. open = false;
  2115. option_instances = {};
  2116. multi_items = {};
  2117. ignore = options.ignore or false;
  2118. items = {};
  2119. y_size;
  2120. seperator = options.seperator or options.Seperator or true;
  2121. }
  2122.  
  2123. cfg.default = options.default or (cfg.multi and {cfg.items[1]}) or cfg.items[1] or "None"
  2124. flags[cfg.flag] = cfg.default
  2125.  
  2126. local items = cfg.items; do
  2127. -- Element
  2128. items[ "dropdown_object" ] = library:create( "TextButton" , {
  2129. FontFace = fonts.small;
  2130. TextColor3 = rgb(0, 0, 0);
  2131. BorderColor3 = rgb(0, 0, 0);
  2132. Text = "";
  2133. Parent = self.items[ "elements" ];
  2134. Name = "\0";
  2135. BackgroundTransparency = 1;
  2136. Size = dim2(1, 0, 0, 0);
  2137. BorderSizePixel = 0;
  2138. AutomaticSize = Enum.AutomaticSize.Y;
  2139. TextSize = 14;
  2140. BackgroundColor3 = rgb(255, 255, 255)
  2141. });
  2142.  
  2143. items[ "name" ] = library:create( "TextLabel" , {
  2144. FontFace = fonts.small;
  2145. TextColor3 = rgb(245, 245, 245);
  2146. BorderColor3 = rgb(0, 0, 0);
  2147. Text = "Dropdown";
  2148. Parent = items[ "dropdown_object" ];
  2149. Name = "\0";
  2150. Size = dim2(1, 0, 0, 0);
  2151. BackgroundTransparency = 1;
  2152. TextXAlignment = Enum.TextXAlignment.Left;
  2153. BorderSizePixel = 0;
  2154. AutomaticSize = Enum.AutomaticSize.XY;
  2155. TextSize = 16;
  2156. BackgroundColor3 = rgb(255, 255, 255)
  2157. });
  2158.  
  2159. if cfg.info then
  2160. items[ "info" ] = library:create( "TextLabel" , {
  2161. FontFace = fonts.small;
  2162. TextColor3 = rgb(130, 130, 130);
  2163. BorderColor3 = rgb(0, 0, 0);
  2164. TextWrapped = true;
  2165. Text = cfg.info;
  2166. Parent = items[ "dropdown_object" ];
  2167. Name = "\0";
  2168. Position = dim2(0, 5, 0, 17);
  2169. Size = dim2(1, -10, 0, 0);
  2170. BackgroundTransparency = 1;
  2171. TextXAlignment = Enum.TextXAlignment.Left;
  2172. BorderSizePixel = 0;
  2173. AutomaticSize = Enum.AutomaticSize.XY;
  2174. TextSize = 16;
  2175. BackgroundColor3 = rgb(255, 255, 255)
  2176. });
  2177. end
  2178.  
  2179. library:create( "UIPadding" , {
  2180. Parent = items[ "name" ];
  2181. PaddingRight = dim(0, 5);
  2182. PaddingLeft = dim(0, 5)
  2183. });
  2184.  
  2185. items[ "right_components" ] = library:create( "Frame" , {
  2186. Parent = items[ "dropdown_object" ];
  2187. Name = "\0";
  2188. Position = dim2(1, 0, 0, 0);
  2189. BorderColor3 = rgb(0, 0, 0);
  2190. Size = dim2(0, 0, 1, 0);
  2191. BorderSizePixel = 0;
  2192. BackgroundColor3 = rgb(255, 255, 255)
  2193. });
  2194.  
  2195. library:create( "UIListLayout" , {
  2196. FillDirection = Enum.FillDirection.Horizontal;
  2197. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  2198. Parent = items[ "right_components" ];
  2199. Padding = dim(0, 7);
  2200. SortOrder = Enum.SortOrder.LayoutOrder
  2201. });
  2202.  
  2203. items[ "dropdown" ] = library:create( "TextButton" , {
  2204. FontFace = fonts.small;
  2205. TextColor3 = rgb(0, 0, 0);
  2206. BorderColor3 = rgb(0, 0, 0);
  2207. Text = "";
  2208. AutoButtonColor = false;
  2209. AnchorPoint = vec2(1, 0);
  2210. Parent = items[ "right_components" ];
  2211. Name = "\0";
  2212. Position = dim2(1, 0, 0, 0);
  2213. Size = dim2(0, cfg.width, 0, cfg.large and 28 or 16);
  2214. BorderSizePixel = 0;
  2215. TextSize = 14;
  2216. BackgroundColor3 = rgb(33, 33, 35)
  2217. });
  2218.  
  2219. library:create( "UICorner" , {
  2220. Parent = items[ "dropdown" ];
  2221. CornerRadius = dim(0, 4)
  2222. });
  2223.  
  2224. items[ "sub_text" ] = library:create( "TextLabel" , {
  2225. FontFace = fonts.small;
  2226. TextColor3 = rgb(86, 86, 87);
  2227. BorderColor3 = rgb(0, 0, 0);
  2228. Text = "awdawdawdawdawdawdawdaw";
  2229. Parent = items[ "dropdown" ];
  2230. Name = "\0";
  2231. Size = dim2(1, -12, 0, 0);
  2232. BorderSizePixel = 0;
  2233. BackgroundTransparency = 1;
  2234. TextXAlignment = Enum.TextXAlignment.Left;
  2235. TextTruncate = Enum.TextTruncate.AtEnd;
  2236. AutomaticSize = Enum.AutomaticSize.Y;
  2237. TextSize = 14;
  2238. BackgroundColor3 = rgb(255, 255, 255)
  2239. });
  2240.  
  2241. library:create( "UIPadding" , {
  2242. Parent = items[ "sub_text" ];
  2243. PaddingTop = dim(0, 1);
  2244. PaddingRight = dim(0, 5);
  2245. PaddingLeft = dim(0, 5)
  2246. });
  2247.  
  2248. items[ "indicator" ] = library:create( "ImageLabel" , {
  2249. ImageColor3 = rgb(86, 86, 87);
  2250. BorderColor3 = rgb(0, 0, 0);
  2251. Parent = items[ "dropdown" ];
  2252. AnchorPoint = vec2(1, 0.5);
  2253. Image = "rbxassetid://101025591575185";
  2254. BackgroundTransparency = 1;
  2255. Position = dim2(1, -5, 0.5, 0);
  2256. Name = "\0";
  2257. Size = dim2(0, 12, 0, 12);
  2258. BorderSizePixel = 0;
  2259. BackgroundColor3 = rgb(255, 255, 255)
  2260. });
  2261. --
  2262.  
  2263. -- Element Holder
  2264. items[ "dropdown_holder" ] = library:create( "Frame" , {
  2265. BorderColor3 = rgb(0, 0, 0);
  2266. Parent = library[ "items" ];
  2267. Name = "\0";
  2268. Visible = true;
  2269. BackgroundTransparency = 1;
  2270. Size = dim2(0, 0, 0, 0);
  2271. BorderSizePixel = 0;
  2272. BackgroundColor3 = rgb(0, 0, 0);
  2273. ZIndex = 10;
  2274. });
  2275.  
  2276. items[ "outline" ] = library:create( "Frame" , {
  2277. Parent = items[ "dropdown_holder" ];
  2278. Size = dim2(1, 0, 1, 0);
  2279. ClipsDescendants = true;
  2280. BorderColor3 = rgb(0, 0, 0);
  2281. BorderSizePixel = 0;
  2282. BackgroundColor3 = rgb(33, 33, 35);
  2283. ZIndex = 10;
  2284. });
  2285.  
  2286. library:create( "UIPadding" , {
  2287. PaddingBottom = dim(0, 6);
  2288. PaddingTop = dim(0, 3);
  2289. PaddingLeft = dim(0, 3);
  2290. Parent = items[ "outline" ]
  2291. });
  2292.  
  2293. library:create( "UIListLayout" , {
  2294. Parent = items[ "outline" ];
  2295. Padding = dim(0, 5);
  2296. SortOrder = Enum.SortOrder.LayoutOrder
  2297. });
  2298.  
  2299. library:create( "UICorner" , {
  2300. Parent = items[ "outline" ];
  2301. CornerRadius = dim(0, 4)
  2302. });
  2303. --
  2304. end
  2305.  
  2306. if cfg.search then
  2307. items[ "search_input" ] = library:create( "TextBox" , {
  2308. FontFace = fonts.small;
  2309. Text = "";
  2310. PlaceholderText = "Search...";
  2311. PlaceholderColor3 = rgb(86, 86, 87);
  2312. ClearTextOnFocus = false;
  2313. LayoutOrder = -1;
  2314. Parent = items[ "outline" ];
  2315. Name = "\0";
  2316. Size = dim2(1, -6, 0, 22);
  2317. BorderSizePixel = 0;
  2318. TextSize = 13;
  2319. BackgroundColor3 = rgb(44, 44, 46);
  2320. TextColor3 = rgb(245, 245, 245);
  2321. BorderColor3 = rgb(0, 0, 0);
  2322. ZIndex = 11;
  2323. });
  2324. library:create( "UICorner" , {Parent = items[ "search_input" ]; CornerRadius = dim(0, 3)});
  2325. library:create( "UIPadding" , {Parent = items[ "search_input" ]; PaddingLeft = dim(0, 5)});
  2326. items[ "search_input" ]:GetPropertyChangedSignal("Text"):Connect(function()
  2327. local q = items[ "search_input" ].Text:lower()
  2328. local filtered = {}
  2329. for _, opt in cfg.options do
  2330. if q == "" or opt:lower():find(q, 1, true) then
  2331. insert(filtered, opt)
  2332. end
  2333. end
  2334. cfg.refresh_options(filtered)
  2335. cfg.y_size = cfg.y_size + 27
  2336. library:tween(items[ "dropdown_holder" ], {Size = dim2(0, items[ "dropdown" ].AbsoluteSize.X, 0, cfg.y_size)})
  2337. end)
  2338. end
  2339.  
  2340. function cfg.render_option(text)
  2341. local button = library:create( "TextButton" , {
  2342. FontFace = fonts.small;
  2343. TextColor3 = rgb(72, 72, 73);
  2344. BorderColor3 = rgb(0, 0, 0);
  2345. Text = text;
  2346. Parent = items[ "outline" ];
  2347. Name = "\0";
  2348. Size = dim2(1, -12, 0, 0);
  2349. BackgroundTransparency = 1;
  2350. TextXAlignment = Enum.TextXAlignment.Left;
  2351. BorderSizePixel = 0;
  2352. AutomaticSize = Enum.AutomaticSize.Y;
  2353. TextSize = 14;
  2354. BackgroundColor3 = rgb(255, 255, 255);
  2355. ZIndex = 10;
  2356. }); library:apply_theme(button, "accent", "TextColor3");
  2357.  
  2358. library:create( "UIPadding" , {
  2359. Parent = button;
  2360. PaddingTop = dim(0, 1);
  2361. PaddingRight = dim(0, 5);
  2362. PaddingLeft = dim(0, 5)
  2363. });
  2364.  
  2365. return button
  2366. end
  2367.  
  2368. function cfg.set_visible(bool)
  2369. local a = bool and cfg.y_size or 0
  2370. library:tween(items[ "dropdown_holder" ], {Size = dim_offset(items[ "dropdown" ].AbsoluteSize.X, a)})
  2371.  
  2372. items[ "dropdown_holder" ].Position = dim2(0, items[ "dropdown" ].AbsolutePosition.X, 0, items[ "dropdown" ].AbsolutePosition.Y + 80)
  2373. if not (self.sanity and library.current_open == self) then
  2374. library:close_element(cfg)
  2375. end
  2376. end
  2377.  
  2378. function cfg.set(value)
  2379. local selected = {}
  2380. local isTable = type(value) == "table"
  2381.  
  2382. for _, option in cfg.option_instances do
  2383. if option.Text == value or (isTable and find(value, option.Text)) then
  2384. insert(selected, option.Text)
  2385. cfg.multi_items = selected
  2386. option.TextColor3 = themes.preset.accent
  2387. else
  2388. option.TextColor3 = rgb(72, 72, 73)
  2389. end
  2390. end
  2391.  
  2392. items[ "sub_text" ].Text = isTable and concat(selected, ", ") or selected[1] or ""
  2393. flags[cfg.flag] = isTable and selected or selected[1]
  2394.  
  2395. cfg.callback(flags[cfg.flag])
  2396. end
  2397.  
  2398. function cfg.refresh_options(list)
  2399. cfg.y_size = 0
  2400.  
  2401. for _, option in cfg.option_instances do
  2402. option:Destroy()
  2403. end
  2404.  
  2405. cfg.option_instances = {}
  2406.  
  2407. for _, option in list do
  2408. local button = cfg.render_option(option)
  2409. cfg.y_size += button.AbsoluteSize.Y + 6 -- super annoying manual sizing but oh well
  2410. insert(cfg.option_instances, button)
  2411.  
  2412. button.MouseButton1Down:Connect(function()
  2413. if cfg.multi then
  2414. local selected_index = find(cfg.multi_items, button.Text)
  2415.  
  2416. if selected_index then
  2417. remove(cfg.multi_items, selected_index)
  2418. else
  2419. insert(cfg.multi_items, button.Text)
  2420. end
  2421.  
  2422. cfg.set(cfg.multi_items)
  2423. else
  2424. cfg.set_visible(false)
  2425. cfg.open = false
  2426.  
  2427. cfg.set(button.Text)
  2428. end
  2429. end)
  2430. end
  2431. end
  2432.  
  2433. items[ "dropdown" ].MouseButton1Click:Connect(function()
  2434. cfg.open = not cfg.open
  2435.  
  2436. cfg.set_visible(cfg.open)
  2437. end)
  2438.  
  2439. if cfg.seperator then
  2440. library:create( "Frame" , {
  2441. AnchorPoint = vec2(0, 1);
  2442. Parent = self.items[ "elements" ];
  2443. Position = dim2(0, 0, 1, 0);
  2444. BorderColor3 = rgb(0, 0, 0);
  2445. Size = dim2(1, 1, 0, 1);
  2446. BorderSizePixel = 0;
  2447. BackgroundColor3 = rgb(36, 36, 37)
  2448. });
  2449. end
  2450.  
  2451. flags[cfg.flag] = {}
  2452. config_flags[cfg.flag] = cfg.set
  2453.  
  2454. cfg.refresh_options(cfg.options)
  2455. if cfg.search then cfg.y_size = cfg.y_size + 27 end
  2456. cfg.set(cfg.default)
  2457.  
  2458. return setmetatable(cfg, library)
  2459. end
  2460.  
  2461. function library:label(options)
  2462. local cfg = {
  2463. enabled = options.enabled or nil,
  2464. name = options.name or "Toggle",
  2465. seperator = options.seperator or options.Seperator or false;
  2466. info = options.info or nil;
  2467.  
  2468. items = {};
  2469. }
  2470.  
  2471. local items = cfg.items; do
  2472. items[ "label" ] = library:create( "TextButton" , {
  2473. FontFace = fonts.small;
  2474. TextColor3 = rgb(0, 0, 0);
  2475. BorderColor3 = rgb(0, 0, 0);
  2476. Text = "";
  2477. Parent = self.items[ "elements" ];
  2478. Name = "\0";
  2479. BackgroundTransparency = 1;
  2480. Size = dim2(1, 0, 0, 0);
  2481. BorderSizePixel = 0;
  2482. AutomaticSize = Enum.AutomaticSize.Y;
  2483. TextSize = 14;
  2484. BackgroundColor3 = rgb(255, 255, 255)
  2485. });
  2486.  
  2487. items[ "name" ] = library:create( "TextLabel" , {
  2488. FontFace = fonts.small;
  2489. TextColor3 = rgb(245, 245, 245);
  2490. BorderColor3 = rgb(0, 0, 0);
  2491. Text = cfg.name;
  2492. Parent = items[ "label" ];
  2493. Name = "\0";
  2494. Size = dim2(1, 0, 0, 0);
  2495. BackgroundTransparency = 1;
  2496. TextXAlignment = Enum.TextXAlignment.Left;
  2497. BorderSizePixel = 0;
  2498. AutomaticSize = Enum.AutomaticSize.XY;
  2499. TextSize = 16;
  2500. BackgroundColor3 = rgb(255, 255, 255)
  2501. });
  2502.  
  2503. if cfg.info then
  2504. items[ "info" ] = library:create( "TextLabel" , {
  2505. FontFace = fonts.small;
  2506. TextColor3 = rgb(130, 130, 130);
  2507. BorderColor3 = rgb(0, 0, 0);
  2508. TextWrapped = true;
  2509. Text = cfg.info;
  2510. Parent = items[ "label" ];
  2511. Name = "\0";
  2512. Position = dim2(0, 5, 0, 17);
  2513. Size = dim2(1, -10, 0, 0);
  2514. BackgroundTransparency = 1;
  2515. TextXAlignment = Enum.TextXAlignment.Left;
  2516. BorderSizePixel = 0;
  2517. AutomaticSize = Enum.AutomaticSize.XY;
  2518. TextSize = 16;
  2519. BackgroundColor3 = rgb(255, 255, 255)
  2520. });
  2521. end
  2522.  
  2523. library:create( "UIPadding" , {
  2524. Parent = items[ "name" ];
  2525. PaddingRight = dim(0, 5);
  2526. PaddingLeft = dim(0, 5)
  2527. });
  2528.  
  2529. items[ "right_components" ] = library:create( "Frame" , {
  2530. Parent = items[ "label" ];
  2531. Name = "\0";
  2532. Position = dim2(1, 0, 0, 0);
  2533. BorderColor3 = rgb(0, 0, 0);
  2534. Size = dim2(0, 0, 1, 0);
  2535. BorderSizePixel = 0;
  2536. BackgroundColor3 = rgb(255, 255, 255)
  2537. });
  2538.  
  2539. library:create( "UIListLayout" , {
  2540. FillDirection = Enum.FillDirection.Horizontal;
  2541. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  2542. Parent = items[ "right_components" ];
  2543. Padding = dim(0, 9);
  2544. SortOrder = Enum.SortOrder.LayoutOrder
  2545. });
  2546. end
  2547.  
  2548. if cfg.seperator then
  2549. library:create( "Frame" , {
  2550. AnchorPoint = vec2(0, 1);
  2551. Parent = self.items[ "elements" ];
  2552. Position = dim2(0, 0, 1, 0);
  2553. BorderColor3 = rgb(0, 0, 0);
  2554. Size = dim2(1, 1, 0, 1);
  2555. BorderSizePixel = 0;
  2556. BackgroundColor3 = rgb(36, 36, 37)
  2557. });
  2558. end
  2559.  
  2560. return setmetatable(cfg, library)
  2561. end
  2562.  
  2563. function library:colorpicker(options)
  2564. local cfg = {
  2565. name = options.name or "Color",
  2566. flag = options.flag or library:next_flag(),
  2567.  
  2568. color = options.color or color(1, 1, 1), -- Default to white color if not provided
  2569. alpha = options.alpha and 1 - options.alpha or 0,
  2570.  
  2571. open = false,
  2572. callback = options.callback or function() end,
  2573. items = {};
  2574.  
  2575. seperator = options.seperator or options.Seperator or false;
  2576. }
  2577.  
  2578. local dragging_sat = false
  2579. local dragging_hue = false
  2580. local dragging_alpha = false
  2581.  
  2582. local h, s, v = cfg.color:ToHSV()
  2583. local a = cfg.alpha
  2584.  
  2585. flags[cfg.flag] = {Color = cfg.color, Transparency = cfg.alpha}
  2586.  
  2587. local label;
  2588. if not self.items.right_components then
  2589. label = self:label({name = cfg.name, seperator = cfg.seperator})
  2590. end
  2591.  
  2592. local items = cfg.items; do
  2593. -- Component
  2594. items[ "colorpicker" ] = library:create( "TextButton" , {
  2595. FontFace = fonts.small;
  2596. TextColor3 = rgb(0, 0, 0);
  2597. BorderColor3 = rgb(0, 0, 0);
  2598. Text = "";
  2599. AutoButtonColor = false;
  2600. AnchorPoint = vec2(1, 0);
  2601. Parent = label and label.items.right_components or self.items[ "right_components" ];
  2602. Name = "\0";
  2603. Position = dim2(1, 0, 0, 0);
  2604. Size = dim2(0, 16, 0, 16);
  2605. BorderSizePixel = 0;
  2606. TextSize = 14;
  2607. BackgroundColor3 = rgb(54, 31, 184)
  2608. });
  2609.  
  2610. library:create( "UICorner" , {
  2611. Parent = items[ "colorpicker" ];
  2612. CornerRadius = dim(0, 4)
  2613. });
  2614.  
  2615. items[ "colorpicker_inline" ] = library:create( "Frame" , {
  2616. Parent = items[ "colorpicker" ];
  2617. Size = dim2(1, -2, 1, -2);
  2618. Name = "\0";
  2619. BorderMode = Enum.BorderMode.Inset;
  2620. BorderColor3 = rgb(0, 0, 0);
  2621. Position = dim2(0, 1, 0, 1);
  2622. BorderSizePixel = 0;
  2623. BackgroundColor3 = rgb(54, 31, 184)
  2624. });
  2625.  
  2626. library:create( "UICorner" , {
  2627. Parent = items[ "colorpicker_inline" ];
  2628. CornerRadius = dim(0, 4)
  2629. });
  2630.  
  2631. library:create( "UIGradient" , {
  2632. Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))};
  2633. Parent = items[ "colorpicker_inline" ]
  2634. });
  2635. --
  2636.  
  2637. -- Colorpicker
  2638. items[ "colorpicker_holder" ] = library:create( "Frame" , {
  2639. Parent = library[ "other" ];
  2640. Name = "\0";
  2641. Position = dim2(0.20000000298023224, 20, 0.296999990940094, 0);
  2642. BorderColor3 = rgb(0, 0, 0);
  2643. Size = dim2(0, 166, 0, 197);
  2644. BorderSizePixel = 0;
  2645. Visible = true;
  2646. BackgroundColor3 = rgb(25, 25, 29)
  2647. });
  2648.  
  2649. items[ "colorpicker_fade" ] = library:create( "Frame" , {
  2650. Parent = items[ "colorpicker_holder" ];
  2651. Name = "\0";
  2652. BackgroundTransparency = 0;
  2653. Position = dim2(0, 0, 0, 0);
  2654. BorderColor3 = rgb(0, 0, 0);
  2655. Size = dim2(1, 0, 1, 0);
  2656. BorderSizePixel = 0;
  2657. ZIndex = 100;
  2658. BackgroundColor3 = rgb(25, 25, 29)
  2659. });
  2660.  
  2661. items[ "colorpicker_components" ] = library:create( "Frame" , {
  2662. Parent = items[ "colorpicker_holder" ];
  2663. Name = "\0";
  2664. Position = dim2(0, 1, 0, 1);
  2665. BorderColor3 = rgb(0, 0, 0);
  2666. Size = dim2(1, -2, 1, -2);
  2667. BorderSizePixel = 0;
  2668. BackgroundColor3 = rgb(22, 22, 24)
  2669. });
  2670.  
  2671. library:create( "UICorner" , {
  2672. Parent = items[ "colorpicker_components" ];
  2673. CornerRadius = dim(0, 6)
  2674. });
  2675.  
  2676. items[ "saturation_holder" ] = library:create( "Frame" , {
  2677. Parent = items[ "colorpicker_components" ];
  2678. Name = "\0";
  2679. Position = dim2(0, 7, 0, 7);
  2680. BorderColor3 = rgb(0, 0, 0);
  2681. Size = dim2(1, -14, 1, -80);
  2682. BorderSizePixel = 0;
  2683. BackgroundColor3 = rgb(255, 39, 39)
  2684. });
  2685.  
  2686. items[ "sat" ] = library:create( "TextButton" , {
  2687. Parent = items[ "saturation_holder" ];
  2688. Name = "\0";
  2689. Size = dim2(1, 0, 1, 0);
  2690. Text = "";
  2691. AutoButtonColor = false;
  2692. BorderColor3 = rgb(0, 0, 0);
  2693. ZIndex = 2;
  2694. BorderSizePixel = 0;
  2695. BackgroundColor3 = rgb(255, 255, 255)
  2696. });
  2697.  
  2698. library:create( "UICorner" , {
  2699. Parent = items[ "sat" ];
  2700. CornerRadius = dim(0, 4)
  2701. });
  2702.  
  2703. library:create( "UIGradient" , {
  2704. Rotation = 270;
  2705. Transparency = numseq{numkey(0, 0), numkey(1, 1)};
  2706. Parent = items[ "sat" ];
  2707. Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(0, 0, 0))}
  2708. });
  2709.  
  2710. items[ "val" ] = library:create( "Frame" , {
  2711. Name = "\0";
  2712. Parent = items[ "saturation_holder" ];
  2713. BorderColor3 = rgb(0, 0, 0);
  2714. Size = dim2(1, 0, 1, 0);
  2715. BorderSizePixel = 0;
  2716. BackgroundColor3 = rgb(255, 255, 255)
  2717. });
  2718.  
  2719. library:create( "UIGradient" , {
  2720. Parent = items[ "val" ];
  2721. Transparency = numseq{numkey(0, 0), numkey(1, 1)}
  2722. });
  2723.  
  2724. library:create( "UICorner" , {
  2725. Parent = items[ "val" ];
  2726. CornerRadius = dim(0, 4)
  2727. });
  2728.  
  2729. library:create( "UICorner" , {
  2730. Parent = items[ "saturation_holder" ];
  2731. CornerRadius = dim(0, 4)
  2732. });
  2733.  
  2734. items[ "satvalpicker" ] = library:create( "TextButton" , {
  2735. BorderColor3 = rgb(0, 0, 0);
  2736. AutoButtonColor = false;
  2737. Text = "";
  2738. AnchorPoint = vec2(0, 1);
  2739. Parent = items[ "saturation_holder" ];
  2740. Name = "\0";
  2741. Position = dim2(0, 0, 4, 0);
  2742. Size = dim2(0, 8, 0, 8);
  2743. ZIndex = 5;
  2744. BorderSizePixel = 0;
  2745. BackgroundColor3 = rgb(255, 0, 0)
  2746. });
  2747.  
  2748. library:create( "UICorner" , {
  2749. Parent = items[ "satvalpicker" ];
  2750. CornerRadius = dim(0, 9999)
  2751. });
  2752.  
  2753. library:create( "UIStroke" , {
  2754. Color = rgb(255, 255, 255);
  2755. Parent = items[ "satvalpicker" ];
  2756. ApplyStrokeMode = Enum.ApplyStrokeMode.Border;
  2757. });
  2758.  
  2759. items[ "hue_gradient" ] = library:create( "TextButton" , {
  2760. Parent = items[ "colorpicker_components" ];
  2761. Name = "\0";
  2762. Position = dim2(0, 10, 1, -64);
  2763. BorderColor3 = rgb(0, 0, 0);
  2764. Size = dim2(1, -20, 0, 8);
  2765. BorderSizePixel = 0;
  2766. BackgroundColor3 = rgb(255, 255, 255);
  2767. AutoButtonColor = false;
  2768. Text = "";
  2769. });
  2770.  
  2771. library:create( "UIGradient" , {
  2772. Color = rgbseq{rgbkey(0, rgb(255, 0, 0)), rgbkey(0.17, rgb(255, 255, 0)), rgbkey(0.33, rgb(0, 255, 0)), rgbkey(0.5, rgb(0, 255, 255)), rgbkey(0.67, rgb(0, 0, 255)), rgbkey(0.83, rgb(255, 0, 255)), rgbkey(1, rgb(255, 0, 0))};
  2773. Parent = items[ "hue_gradient" ]
  2774. });
  2775.  
  2776. library:create( "UICorner" , {
  2777. Parent = items[ "hue_gradient" ];
  2778. CornerRadius = dim(0, 6)
  2779. });
  2780.  
  2781. items[ "hue_picker" ] = library:create( "TextButton" , {
  2782. BorderColor3 = rgb(0, 0, 0);
  2783. AutoButtonColor = false;
  2784. Text = "";
  2785. AnchorPoint = vec2(0, 0.5);
  2786. Parent = items[ "hue_gradient" ];
  2787. Name = "\0";
  2788. Position = dim2(0, 0, 0.5, 0);
  2789. Size = dim2(0, 8, 0, 8);
  2790. ZIndex = 5;
  2791. BorderSizePixel = 0;
  2792. BackgroundColor3 = rgb(255, 0, 0)
  2793. });
  2794.  
  2795. library:create( "UICorner" , {
  2796. Parent = items[ "hue_picker" ];
  2797. CornerRadius = dim(0, 9999)
  2798. });
  2799.  
  2800. library:create( "UIStroke" , {
  2801. Color = rgb(255, 255, 255);
  2802. Parent = items[ "hue_picker" ];
  2803. ApplyStrokeMode = Enum.ApplyStrokeMode.Border;
  2804. });
  2805.  
  2806. items[ "alpha_gradient" ] = library:create( "TextButton" , {
  2807. Parent = items[ "colorpicker_components" ];
  2808. Name = "\0";
  2809. Position = dim2(0, 10, 1, -46);
  2810. BorderColor3 = rgb(0, 0, 0);
  2811. Size = dim2(1, -20, 0, 8);
  2812. BorderSizePixel = 0;
  2813. BackgroundColor3 = rgb(25, 25, 29);
  2814. AutoButtonColor = false;
  2815. Text = "";
  2816. });
  2817.  
  2818. library:create( "UICorner" , {
  2819. Parent = items[ "alpha_gradient" ];
  2820. CornerRadius = dim(0, 6)
  2821. });
  2822.  
  2823. items[ "alpha_picker" ] = library:create( "TextButton" , {
  2824. BorderColor3 = rgb(0, 0, 0);
  2825. AutoButtonColor = false;
  2826. Text = "";
  2827. AnchorPoint = vec2(0, 0.5);
  2828. Parent = items[ "alpha_gradient" ];
  2829. Name = "\0";
  2830. Position = dim2(1, 0, 0.5, 0);
  2831. Size = dim2(0, 8, 0, 8);
  2832. ZIndex = 5;
  2833. BorderSizePixel = 0;
  2834. BackgroundColor3 = rgb(255, 0, 0)
  2835. });
  2836.  
  2837. library:create( "UICorner" , {
  2838. Parent = items[ "alpha_picker" ];
  2839. CornerRadius = dim(0, 9999)
  2840. });
  2841.  
  2842. library:create( "UIStroke" , {
  2843. Color = rgb(255, 255, 255);
  2844. ApplyStrokeMode = Enum.ApplyStrokeMode.Border;
  2845. Parent = items[ "alpha_picker" ]
  2846. });
  2847.  
  2848. library:create( "UIGradient" , {
  2849. Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(255, 255, 255))};
  2850. Parent = items[ "alpha_gradient" ]
  2851. });
  2852.  
  2853. items[ "alpha_indicator" ] = library:create( "ImageLabel" , {
  2854. ScaleType = Enum.ScaleType.Tile;
  2855. BorderColor3 = rgb(0, 0, 0);
  2856. Parent = items[ "alpha_gradient" ];
  2857. Image = "rbxassetid://18274452449";
  2858. BackgroundTransparency = 1;
  2859. Name = "\0";
  2860. Size = dim2(1, 0, 1, 0);
  2861. TileSize = dim2(0, 6, 0, 6);
  2862. BorderSizePixel = 0;
  2863. BackgroundColor3 = rgb(0, 0, 0)
  2864. });
  2865.  
  2866. library:create( "UIGradient" , {
  2867. Color = rgbseq{rgbkey(0, rgb(112, 112, 112)), rgbkey(1, rgb(255, 0, 0))};
  2868. Transparency = numseq{numkey(0, 0.8062499761581421), numkey(1, 0)};
  2869. Parent = items[ "alpha_indicator" ]
  2870. });
  2871.  
  2872. library:create( "UICorner" , {
  2873. Parent = items[ "alpha_indicator" ];
  2874. CornerRadius = dim(0, 6)
  2875. });
  2876.  
  2877. library:create( "UIGradient" , {
  2878. Rotation = 90;
  2879. Parent = items[ "colorpicker_components" ];
  2880. Color = rgbseq{rgbkey(0, rgb(255, 255, 255)), rgbkey(1, rgb(66, 66, 66))}
  2881. });
  2882.  
  2883. items[ "input" ] = library:create( "TextBox" , {
  2884. FontFace = fonts.font;
  2885. AnchorPoint = vec2(1, 1);
  2886. Text = "";
  2887. Parent = items[ "colorpicker_components" ];
  2888. Name = "\0";
  2889. TextTruncate = Enum.TextTruncate.AtEnd;
  2890. BorderSizePixel = 0;
  2891. PlaceholderColor3 = rgb(255, 255, 255);
  2892. CursorPosition = -1;
  2893. ClearTextOnFocus = false;
  2894. TextSize = 14;
  2895. BackgroundColor3 = rgb(255, 255, 255);
  2896. TextColor3 = rgb(72, 72, 72);
  2897. BorderColor3 = rgb(0, 0, 0);
  2898. Position = dim2(1, -8, 1, -11);
  2899. Size = dim2(1, -16, 0, 18);
  2900. BackgroundColor3 = rgb(33, 33, 35)
  2901. });
  2902.  
  2903. library:create( "UICorner" , {
  2904. Parent = items[ "input" ];
  2905. CornerRadius = dim(0, 3)
  2906. });
  2907.  
  2908. items[ "UICorenr" ] = library:create( "UICorner" , { -- fire misstypo (im not fixing this RAWR)
  2909. Parent = items[ "colorpicker_holder" ];
  2910. Name = "\0";
  2911. CornerRadius = dim(0, 4)
  2912. });
  2913. --
  2914. end;
  2915.  
  2916. function cfg.set_visible(bool)
  2917. items[ "colorpicker_fade" ].BackgroundTransparency = 0
  2918. items[ "colorpicker_holder" ].Parent = bool and library[ "items" ] or library[ "other" ]
  2919. items[ "colorpicker_holder" ].Position = dim_offset(items[ "colorpicker" ].AbsolutePosition.X, items[ "colorpicker" ].AbsolutePosition.Y + items[ "colorpicker" ].AbsoluteSize.Y + 45)
  2920.  
  2921. library:tween(items[ "colorpicker_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4)
  2922. library:tween(items[ "colorpicker_holder" ], {Position = items[ "colorpicker_holder" ].Position + dim_offset(0, 20)}) -- p100 check
  2923.  
  2924. if not (self.sanity and library.current_open == self and self.open) then
  2925. library:close_element(cfg)
  2926. end
  2927. end
  2928.  
  2929. function cfg.set(color, alpha)
  2930. if type(color) == "boolean" then
  2931. return
  2932. end
  2933.  
  2934. if color then
  2935. h, s, v = color:ToHSV()
  2936. end
  2937.  
  2938. if alpha then
  2939. a = alpha
  2940. end
  2941.  
  2942. local Color = hsv(h, s, v)
  2943.  
  2944. -- Ok so quick story, should I cache any of this? no...?? anyways I know this code is very bad but its your fault for buying a ui with animations (on a serious note im too lazy to make this look nice)
  2945. -- Also further note, yeah I kind of did this scale_factor * size-valuesize.plane because then I would have to do tomfoolery to make it clip properly.
  2946. library:tween(items[ "hue_picker" ], {Position = dim2(0, (items[ "hue_gradient" ].AbsoluteSize.X - items[ "hue_picker" ].AbsoluteSize.X) * h, 0.5, 0)}, Enum.EasingStyle.Linear, 0.05)
  2947. library:tween(items[ "alpha_picker" ], {Position = dim2(0, (items[ "alpha_gradient" ].AbsoluteSize.X - items[ "alpha_picker" ].AbsoluteSize.X) * (1 - a), 0.5, 0)}, Enum.EasingStyle.Linear, 0.05)
  2948. library:tween(items[ "satvalpicker" ], {Position = dim2(0, s * (items[ "saturation_holder" ].AbsoluteSize.X - items[ "satvalpicker" ].AbsoluteSize.X), 1, 1 - v * (items[ "saturation_holder" ].AbsoluteSize.Y - items[ "satvalpicker" ].AbsoluteSize.Y))}, Enum.EasingStyle.Linear, 0.05)
  2949.  
  2950. items[ "alpha_indicator" ]:FindFirstChildOfClass("UIGradient").Color = rgbseq{rgbkey(0, rgb(112, 112, 112)), rgbkey(1, hsv(h, 1, 1))}; -- shit code
  2951.  
  2952. items[ "colorpicker" ].BackgroundColor3 = Color
  2953. items[ "colorpicker_inline" ].BackgroundColor3 = Color
  2954. items[ "saturation_holder" ].BackgroundColor3 = hsv(h, 1, 1)
  2955.  
  2956. items[ "hue_picker" ].BackgroundColor3 = hsv(h, 1, 1)
  2957. items[ "alpha_picker" ].BackgroundColor3 = hsv(h, 1, 1 - a)
  2958. items[ "satvalpicker" ].BackgroundColor3 = hsv(h, s, v)
  2959.  
  2960. flags[cfg.flag] = {
  2961. Color = Color;
  2962. Transparency = a
  2963. }
  2964.  
  2965. local color = items[ "colorpicker" ].BackgroundColor3
  2966. items[ "input" ].Text = string.format("%s, %s, %s, ", library:round(color.R * 255), library:round(color.G * 255), library:round(color.B * 255))
  2967. items[ "input" ].Text ..= library:round(1 - a, 0.01)
  2968.  
  2969. cfg.callback(Color, a)
  2970. end
  2971.  
  2972. function cfg.update_color()
  2973. local mouse = uis:GetMouseLocation()
  2974. local offset = vec2(mouse.X, mouse.Y - gui_offset)
  2975.  
  2976. if dragging_sat then
  2977. s = math.clamp((offset - items["sat"].AbsolutePosition).X / items["sat"].AbsoluteSize.X, 0, 1)
  2978. v = 1 - math.clamp((offset - items["sat"].AbsolutePosition).Y / items["sat"].AbsoluteSize.Y, 0, 1)
  2979. elseif dragging_hue then
  2980. h = math.clamp((offset - items[ "hue_gradient" ].AbsolutePosition).X / items[ "hue_gradient" ].AbsoluteSize.X, 0, 1)
  2981. elseif dragging_alpha then
  2982. a = 1 - math.clamp((offset - items[ "alpha_gradient" ].AbsolutePosition).X / items[ "alpha_gradient" ].AbsoluteSize.X, 0, 1)
  2983. end
  2984.  
  2985. cfg.set()
  2986. end
  2987.  
  2988. items[ "colorpicker" ].MouseButton1Click:Connect(function()
  2989. cfg.open = not cfg.open
  2990.  
  2991. cfg.set_visible(cfg.open)
  2992. end)
  2993.  
  2994. uis.InputChanged:Connect(function(input)
  2995. if (dragging_sat or dragging_hue or dragging_alpha) and input.UserInputType == Enum.UserInputType.MouseMovement then
  2996. cfg.update_color()
  2997. end
  2998. end)
  2999.  
  3000. library:connection(uis.InputEnded, function(input)
  3001. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3002. dragging_sat = false
  3003. dragging_hue = false
  3004. dragging_alpha = false
  3005. end
  3006. end)
  3007.  
  3008. items[ "alpha_gradient" ].MouseButton1Down:Connect(function()
  3009. dragging_alpha = true
  3010. end)
  3011.  
  3012. items[ "hue_gradient" ].MouseButton1Down:Connect(function()
  3013. dragging_hue = true
  3014. end)
  3015.  
  3016. items[ "sat" ].MouseButton1Down:Connect(function()
  3017. dragging_sat = true
  3018. end)
  3019.  
  3020. items[ "input" ].FocusLost:Connect(function()
  3021. local text = items[ "input" ].Text
  3022. local r, g, b, a = library:convert(text)
  3023.  
  3024. if r and g and b and a then
  3025. cfg.set(rgb(r, g, b), 1 - a)
  3026. end
  3027. end)
  3028.  
  3029. items[ "input" ].Focused:Connect(function()
  3030. library:tween(items[ "input" ], {TextColor3 = rgb(245, 245, 245)})
  3031. end)
  3032.  
  3033. items[ "input" ].FocusLost:Connect(function()
  3034. library:tween(items[ "input" ], {TextColor3 = rgb(72, 72, 72)})
  3035. end)
  3036.  
  3037. cfg.set(cfg.color, cfg.alpha)
  3038. config_flags[cfg.flag] = cfg.set
  3039.  
  3040. return setmetatable(cfg, library)
  3041. end
  3042.  
  3043. function library:textbox(options)
  3044. local cfg = {
  3045. name = options.name or "TextBox",
  3046. placeholder = options.placeholder or options.placeholdertext or options.holder or options.holdertext or "type here...",
  3047. default = options.default or "",
  3048. flag = options.flag or library:next_flag(),
  3049. callback = options.callback or function() end,
  3050. visible = options.visible or true,
  3051. items = {};
  3052. }
  3053.  
  3054. flags[cfg.flag] = cfg.default
  3055.  
  3056. local items = cfg.items; do
  3057. items[ "textbox" ] = library:create( "TextButton" , {
  3058. LayoutOrder = -1;
  3059. FontFace = fonts.font;
  3060. TextColor3 = rgb(0, 0, 0);
  3061. BorderColor3 = rgb(0, 0, 0);
  3062. Text = "";
  3063. Parent = self.items[ "elements" ];
  3064. Name = "\0";
  3065. BackgroundTransparency = 1;
  3066. Size = dim2(1, 0, 0, 0);
  3067. BorderSizePixel = 0;
  3068. AutomaticSize = Enum.AutomaticSize.Y;
  3069. TextSize = 14;
  3070. BackgroundColor3 = rgb(255, 255, 255)
  3071. });
  3072.  
  3073. items[ "name" ] = library:create( "TextLabel" , {
  3074. FontFace = fonts.font;
  3075. TextColor3 = rgb(245, 245, 245);
  3076. BorderColor3 = rgb(0, 0, 0);
  3077. Text = cfg.name;
  3078. Parent = items[ "textbox" ];
  3079. Name = "\0";
  3080. Size = dim2(1, 0, 0, 0);
  3081. BackgroundTransparency = 1;
  3082. TextXAlignment = Enum.TextXAlignment.Left;
  3083. BorderSizePixel = 0;
  3084. AutomaticSize = Enum.AutomaticSize.XY;
  3085. TextSize = 16;
  3086. BackgroundColor3 = rgb(255, 255, 255)
  3087. });
  3088.  
  3089. library:create( "UIPadding" , {
  3090. Parent = items[ "name" ];
  3091. PaddingRight = dim(0, 5);
  3092. PaddingLeft = dim(0, 5)
  3093. });
  3094.  
  3095. items[ "right_components" ] = library:create( "Frame" , {
  3096. Parent = items[ "textbox" ];
  3097. Name = "\0";
  3098. BackgroundTransparency = 1;
  3099. Position = dim2(0, 4, 0, 19);
  3100. BorderColor3 = rgb(0, 0, 0);
  3101. Size = dim2(1, 0, 0, 12);
  3102. BorderSizePixel = 0;
  3103. BackgroundColor3 = rgb(255, 255, 255)
  3104. });
  3105.  
  3106. library:create( "UIListLayout" , {
  3107. Parent = items[ "right_components" ];
  3108. Padding = dim(0, 7);
  3109. SortOrder = Enum.SortOrder.LayoutOrder;
  3110. FillDirection = Enum.FillDirection.Horizontal
  3111. });
  3112.  
  3113. items[ "input" ] = library:create( "TextBox" , {
  3114. FontFace = fonts.font;
  3115. Text = "";
  3116. Parent = items[ "right_components" ];
  3117. Name = "\0";
  3118. TextTruncate = Enum.TextTruncate.AtEnd;
  3119. BorderSizePixel = 0;
  3120. PlaceholderText = cfg.placeholder;
  3121. PlaceholderColor3 = rgb(86, 86, 87);
  3122. CursorPosition = -1;
  3123. ClearTextOnFocus = false;
  3124. TextSize = 14;
  3125. BackgroundColor3 = rgb(255, 255, 255);
  3126. TextColor3 = rgb(72, 72, 72);
  3127. BorderColor3 = rgb(0, 0, 0);
  3128. Position = dim2(1, 0, 0, 0);
  3129. Size = dim2(1, -4, 0, 30);
  3130. BackgroundColor3 = rgb(33, 33, 35)
  3131. });
  3132.  
  3133. library:create( "UICorner" , {
  3134. Parent = items[ "input" ];
  3135. CornerRadius = dim(0, 3)
  3136. });
  3137.  
  3138. library:create( "UIPadding" , {
  3139. Parent = items[ "right_components" ];
  3140. PaddingTop = dim(0, 4);
  3141. PaddingRight = dim(0, 4)
  3142. });
  3143. end
  3144.  
  3145. function cfg.set(text)
  3146. flags[cfg.flag] = text
  3147.  
  3148. items[ "input" ].Text = text
  3149.  
  3150. cfg.callback(text)
  3151. end
  3152.  
  3153. items[ "input" ]:GetPropertyChangedSignal("Text"):Connect(function()
  3154. cfg.set(items[ "input" ].Text)
  3155. end)
  3156.  
  3157. items[ "input" ].Focused:Connect(function()
  3158. library:tween(items[ "input" ], {TextColor3 = rgb(245, 245, 245)})
  3159. end)
  3160.  
  3161. items[ "input" ].FocusLost:Connect(function()
  3162. library:tween(items[ "input" ], {TextColor3 = rgb(72, 72, 72)})
  3163. end)
  3164.  
  3165. if cfg.default then
  3166. cfg.set(cfg.default)
  3167. end
  3168.  
  3169. config_flags[cfg.flag] = cfg.set
  3170.  
  3171. return setmetatable(cfg, library)
  3172. end
  3173.  
  3174. function library:keybind(options)
  3175. local cfg = {
  3176. flag = options.flag or library:next_flag(),
  3177. callback = options.callback or function() end,
  3178. name = options.name or nil,
  3179. ignore_key = options.ignore or false,
  3180.  
  3181. key = options.key or nil,
  3182. mode = options.mode or "Toggle",
  3183. active = options.default or false,
  3184.  
  3185. open = false,
  3186. binding = nil,
  3187.  
  3188. hold_instances = {},
  3189. items = {};
  3190. }
  3191.  
  3192. flags[cfg.flag] = {
  3193. mode = cfg.mode,
  3194. key = cfg.key,
  3195. active = cfg.active
  3196. }
  3197.  
  3198. local items = cfg.items; do
  3199. -- Component
  3200. items[ "keybind_element" ] = library:create( "TextButton" , {
  3201. FontFace = fonts.font;
  3202. TextColor3 = rgb(0, 0, 0);
  3203. BorderColor3 = rgb(0, 0, 0);
  3204. Text = "";
  3205. Parent = self.items[ "elements" ];
  3206. Name = "\0";
  3207. BackgroundTransparency = 1;
  3208. Size = dim2(1, 0, 0, 0);
  3209. BorderSizePixel = 0;
  3210. AutomaticSize = Enum.AutomaticSize.Y;
  3211. TextSize = 14;
  3212. BackgroundColor3 = rgb(255, 255, 255)
  3213. });
  3214.  
  3215. items[ "name" ] = library:create( "TextLabel" , {
  3216. FontFace = fonts.font;
  3217. TextColor3 = rgb(245, 245, 245);
  3218. BorderColor3 = rgb(0, 0, 0);
  3219. Text = cfg.name;
  3220. Parent = items[ "keybind_element" ];
  3221. Name = "\0";
  3222. Size = dim2(1, 0, 0, 0);
  3223. BackgroundTransparency = 1;
  3224. TextXAlignment = Enum.TextXAlignment.Left;
  3225. BorderSizePixel = 0;
  3226. AutomaticSize = Enum.AutomaticSize.XY;
  3227. TextSize = 16;
  3228. BackgroundColor3 = rgb(255, 255, 255)
  3229. });
  3230.  
  3231. library:create( "UIPadding" , {
  3232. Parent = items[ "name" ];
  3233. PaddingRight = dim(0, 5);
  3234. PaddingLeft = dim(0, 5)
  3235. });
  3236.  
  3237. items[ "right_components" ] = library:create( "Frame" , {
  3238. Parent = items[ "keybind_element" ];
  3239. Name = "\0";
  3240. Position = dim2(1, 0, 0, 0);
  3241. BorderColor3 = rgb(0, 0, 0);
  3242. Size = dim2(0, 0, 1, 0);
  3243. BorderSizePixel = 0;
  3244. BackgroundColor3 = rgb(255, 255, 255)
  3245. });
  3246.  
  3247. library:create( "UIListLayout" , {
  3248. FillDirection = Enum.FillDirection.Horizontal;
  3249. HorizontalAlignment = Enum.HorizontalAlignment.Right;
  3250. Parent = items[ "right_components" ];
  3251. Padding = dim(0, 7);
  3252. SortOrder = Enum.SortOrder.LayoutOrder
  3253. });
  3254.  
  3255. items[ "keybind_holder" ] = library:create( "TextButton" , {
  3256. FontFace = fonts.font;
  3257. TextColor3 = rgb(0, 0, 0);
  3258. BorderColor3 = rgb(0, 0, 0);
  3259. Text = "";
  3260. Parent = items[ "right_components" ];
  3261. AutoButtonColor = false;
  3262. AnchorPoint = vec2(1, 0);
  3263. Size = dim2(0, 0, 0, 16);
  3264. Name = "\0";
  3265. Position = dim2(1, 0, 0, 0);
  3266. BorderSizePixel = 0;
  3267. AutomaticSize = Enum.AutomaticSize.X;
  3268. TextSize = 14;
  3269. BackgroundColor3 = rgb(33, 33, 35)
  3270. });
  3271.  
  3272. library:create( "UICorner" , {
  3273. Parent = items[ "keybind_holder" ];
  3274. CornerRadius = dim(0, 4)
  3275. });
  3276.  
  3277. items[ "key" ] = library:create( "TextLabel" , {
  3278. FontFace = fonts.font;
  3279. TextColor3 = rgb(86, 86, 87);
  3280. BorderColor3 = rgb(0, 0, 0);
  3281. Text = "LSHIFT";
  3282. Parent = items[ "keybind_holder" ];
  3283. Name = "\0";
  3284. Size = dim2(1, -12, 0, 0);
  3285. BackgroundTransparency = 1;
  3286. TextXAlignment = Enum.TextXAlignment.Left;
  3287. BorderSizePixel = 0;
  3288. AutomaticSize = Enum.AutomaticSize.XY;
  3289. TextSize = 14;
  3290. BackgroundColor3 = rgb(255, 255, 255)
  3291. });
  3292.  
  3293. library:create( "UIPadding" , {
  3294. Parent = items[ "key" ];
  3295. PaddingTop = dim(0, 1);
  3296. PaddingRight = dim(0, 5);
  3297. PaddingLeft = dim(0, 5)
  3298. });
  3299. --
  3300.  
  3301. -- Mode Holder
  3302. items[ "dropdown" ] = library:create( "Frame" , {
  3303. BorderColor3 = rgb(0, 0, 0);
  3304. Parent = library.items;
  3305. Name = "\0";
  3306. BackgroundTransparency = 1;
  3307. Position = dim2(0, 0, 0, 0);
  3308. Size = dim2(0, 0, 0, 0);
  3309. BorderSizePixel = 0;
  3310. AutomaticSize = Enum.AutomaticSize.X;
  3311. BackgroundColor3 = rgb(0, 0, 0)
  3312. });
  3313.  
  3314. items[ "inline" ] = library:create( "Frame" , {
  3315. Parent = items[ "dropdown" ];
  3316. Size = dim2(1, 0, 1, 0);
  3317. Name = "\0";
  3318. ClipsDescendants = true;
  3319. BorderColor3 = rgb(0, 0, 0);
  3320. BorderSizePixel = 0;
  3321. BackgroundColor3 = rgb(22, 22, 24)
  3322. });
  3323.  
  3324. library:create( "UIPadding" , {
  3325. PaddingBottom = dim(0, 6);
  3326. PaddingTop = dim(0, 3);
  3327. PaddingLeft = dim(0, 3);
  3328. Parent = items[ "inline" ]
  3329. });
  3330.  
  3331. library:create( "UIListLayout" , {
  3332. Parent = items[ "inline" ];
  3333. Padding = dim(0, 5);
  3334. SortOrder = Enum.SortOrder.LayoutOrder
  3335. });
  3336.  
  3337. library:create( "UICorner" , {
  3338. Parent = items[ "inline" ];
  3339. CornerRadius = dim(0, 4)
  3340. });
  3341.  
  3342. local options = {"Hold", "Toggle", "Always"}
  3343.  
  3344. cfg.y_size = 20
  3345. for _, option in options do
  3346. local name = library:create( "TextButton" , {
  3347. FontFace = fonts.font;
  3348. TextColor3 = rgb(72, 72, 73);
  3349. BorderColor3 = rgb(0, 0, 0);
  3350. Text = option;
  3351. Parent = items[ "inline" ];
  3352. Name = "\0";
  3353. Size = dim2(0, 0, 0, 0);
  3354. BackgroundTransparency = 1;
  3355. TextXAlignment = Enum.TextXAlignment.Left;
  3356. BorderSizePixel = 0;
  3357. AutomaticSize = Enum.AutomaticSize.XY;
  3358. TextSize = 14;
  3359. BackgroundColor3 = rgb(255, 255, 255)
  3360. }); cfg.hold_instances[option] = name
  3361. library:apply_theme(name, "accent", "TextColor3")
  3362.  
  3363. cfg.y_size += name.AbsoluteSize.Y
  3364.  
  3365. library:create( "UIPadding" , {
  3366. Parent = name;
  3367. PaddingTop = dim(0, 1);
  3368. PaddingRight = dim(0, 5);
  3369. PaddingLeft = dim(0, 5)
  3370. });
  3371.  
  3372. name.MouseButton1Click:Connect(function()
  3373. cfg.set(option)
  3374.  
  3375. cfg.set_visible(false)
  3376.  
  3377. cfg.open = false
  3378. end)
  3379. end
  3380. --
  3381. end
  3382.  
  3383. function cfg.modify_mode_color(path) -- ts so frikin tuff 💀
  3384. for _, v in cfg.hold_instances do
  3385. v.TextColor3 = rgb(72, 72, 72)
  3386. end
  3387.  
  3388. cfg.hold_instances[path].TextColor3 = themes.preset.accent
  3389. end
  3390.  
  3391. function cfg.set_mode(mode)
  3392. cfg.mode = mode
  3393.  
  3394. if mode == "Always" then
  3395. cfg.set(true)
  3396. elseif mode == "Hold" then
  3397. cfg.set(false)
  3398. end
  3399.  
  3400. flags[cfg.flag]["mode"] = mode
  3401. cfg.modify_mode_color(mode)
  3402. end
  3403.  
  3404. function cfg.set(input)
  3405. if type(input) == "boolean" then
  3406. cfg.active = input
  3407.  
  3408. if cfg.mode == "Always" then
  3409. cfg.active = true
  3410. end
  3411. elseif tostring(input):find("Enum") then
  3412. input = input.Name == "Escape" and "NONE" or input
  3413.  
  3414. cfg.key = input or "NONE"
  3415. elseif find({"Toggle", "Hold", "Always"}, input) then
  3416. if input == "Always" then
  3417. cfg.active = true
  3418. end
  3419.  
  3420. cfg.mode = input
  3421. cfg.set_mode(cfg.mode)
  3422. elseif type(input) == "table" then
  3423. input.key = type(input.key) == "string" and input.key ~= "NONE" and library:convert_enum(input.key) or input.key
  3424. input.key = input.key == Enum.KeyCode.Escape and "NONE" or input.key
  3425.  
  3426. cfg.key = input.key or "NONE"
  3427. cfg.mode = input.mode or "Toggle"
  3428.  
  3429. if input.active then
  3430. cfg.active = input.active
  3431. end
  3432.  
  3433. cfg.set_mode(cfg.mode)
  3434. end
  3435.  
  3436. cfg.callback(cfg.active)
  3437.  
  3438. local text = tostring(cfg.key) ~= "Enums" and (keys[cfg.key] or tostring(cfg.key):gsub("Enum.", "")) or nil
  3439. local __text = text and (tostring(text):gsub("KeyCode.", ""):gsub("UserInputType.", ""))
  3440.  
  3441. items[ "key" ].Text = __text
  3442.  
  3443. flags[cfg.flag] = {
  3444. mode = cfg.mode,
  3445. key = cfg.key,
  3446. active = cfg.active
  3447. }
  3448. end
  3449.  
  3450. function cfg.set_visible(bool)
  3451. local size = bool and cfg.y_size or 0
  3452. library:tween(items[ "dropdown" ], {Size = dim_offset(items[ "keybind_holder" ].AbsoluteSize.X, size)})
  3453.  
  3454. items[ "dropdown" ].Position = dim_offset(items[ "keybind_holder" ].AbsolutePosition.X, items[ "keybind_holder" ].AbsolutePosition.Y + items[ "keybind_holder" ].AbsoluteSize.Y + 60)
  3455. end
  3456.  
  3457. items[ "keybind_holder" ].MouseButton1Down:Connect(function()
  3458. task.wait()
  3459. items[ "key" ].Text = "..."
  3460.  
  3461. cfg.binding = library:connection(uis.InputBegan, function(keycode, game_event)
  3462. cfg.set(keycode.KeyCode ~= Enum.KeyCode.Unknown and keycode.KeyCode or keycode.UserInputType)
  3463.  
  3464. cfg.binding:Disconnect()
  3465. cfg.binding = nil
  3466. end)
  3467. end)
  3468.  
  3469. items[ "keybind_holder" ].MouseButton2Down:Connect(function()
  3470. cfg.open = not cfg.open
  3471.  
  3472. cfg.set_visible(cfg.open)
  3473. end)
  3474.  
  3475. library:connection(uis.InputBegan, function(input, game_event)
  3476. if not game_event then
  3477. local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
  3478.  
  3479. if selected_key == cfg.key then
  3480. if cfg.mode == "Toggle" then
  3481. cfg.active = not cfg.active
  3482. cfg.set(cfg.active)
  3483. elseif cfg.mode == "Hold" then
  3484. cfg.set(true)
  3485. end
  3486. end
  3487. end
  3488. end)
  3489.  
  3490. library:connection(uis.InputEnded, function(input, game_event)
  3491. if game_event then
  3492. return
  3493. end
  3494.  
  3495. local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
  3496.  
  3497. if selected_key == cfg.key then
  3498. if cfg.mode == "Hold" then
  3499. cfg.set(false)
  3500. end
  3501. end
  3502. end)
  3503.  
  3504. cfg.set({mode = cfg.mode, active = cfg.active, key = cfg.key})
  3505. config_flags[cfg.flag] = cfg.set
  3506.  
  3507. return setmetatable(cfg, library)
  3508. end
  3509.  
  3510. function library:button(options)
  3511. local cfg = {
  3512. name = options.name or "Button",
  3513. callback = options.callback or function() end,
  3514. seperator = options.seperator or false,
  3515. items = {};
  3516. }
  3517.  
  3518. local items = cfg.items; do
  3519. items[ "button_element" ] = library:create( "Frame" , {
  3520. Parent = self.items[ "elements" ];
  3521. Name = "\0";
  3522. BackgroundTransparency = 1;
  3523. Size = dim2(1, 0, 0, 0);
  3524. BorderColor3 = rgb(0, 0, 0);
  3525. BorderSizePixel = 0;
  3526. AutomaticSize = Enum.AutomaticSize.Y;
  3527. BackgroundColor3 = rgb(255, 255, 255)
  3528. });
  3529.  
  3530. items[ "button" ] = library:create( "TextButton" , {
  3531. FontFace = fonts.font;
  3532. TextColor3 = rgb(0, 0, 0);
  3533. BorderColor3 = rgb(0, 0, 0);
  3534. Text = "";
  3535. AutoButtonColor = false;
  3536. Parent = items[ "button_element" ];
  3537. Name = "\0";
  3538. Size = dim2(1, 0, 0, 30);
  3539. BorderSizePixel = 0;
  3540. TextSize = 14;
  3541. BackgroundColor3 = rgb(33, 33, 35)
  3542. });
  3543.  
  3544. library:create( "UICorner" , {
  3545. Parent = items[ "button" ];
  3546. CornerRadius = dim(0, 5)
  3547. });
  3548.  
  3549. library:create( "UIStroke" , {
  3550. Color = rgb(44, 44, 46);
  3551. Parent = items[ "button" ];
  3552. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  3553. });
  3554.  
  3555. items[ "name" ] = library:create( "TextLabel" , {
  3556. FontFace = fonts.font;
  3557. TextColor3 = rgb(245, 245, 245);
  3558. BorderColor3 = rgb(0, 0, 0);
  3559. Text = cfg.name;
  3560. Parent = items[ "button" ];
  3561. Name = "\0";
  3562. BackgroundTransparency = 1;
  3563. AnchorPoint = vec2(0.5, 0.5);
  3564. Position = dim2(0.5, 0, 0.5, 0);
  3565. Size = dim2(1, 0, 1, 0);
  3566. BorderSizePixel = 0;
  3567. TextXAlignment = Enum.TextXAlignment.Center;
  3568. TextSize = 14;
  3569. BackgroundColor3 = rgb(255, 255, 255)
  3570. });
  3571.  
  3572. if cfg.seperator then
  3573. library:create( "Frame" , {
  3574. Parent = items[ "button_element" ];
  3575. BorderColor3 = rgb(0, 0, 0);
  3576. Size = dim2(1, 0, 0, 1);
  3577. Position = dim2(0, 0, 0, 31);
  3578. BorderSizePixel = 0;
  3579. BackgroundColor3 = rgb(36, 36, 37)
  3580. });
  3581. end
  3582. end
  3583.  
  3584. items[ "button" ].MouseButton1Click:Connect(function()
  3585. cfg.callback()
  3586. library:tween(items[ "button" ], {BackgroundColor3 = themes.preset.accent}, Enum.EasingStyle.Quad, 0.1)
  3587. library:tween(items[ "button" ], {BackgroundColor3 = rgb(33, 33, 35)}, Enum.EasingStyle.Quad, 0.3)
  3588. end)
  3589.  
  3590. items[ "button" ].MouseEnter:Connect(function()
  3591. library:tween(items[ "button" ], {BackgroundColor3 = rgb(44, 44, 46)})
  3592. end)
  3593.  
  3594. items[ "button" ].MouseLeave:Connect(function()
  3595. library:tween(items[ "button" ], {BackgroundColor3 = rgb(33, 33, 35)})
  3596. end)
  3597.  
  3598. return setmetatable(cfg, library)
  3599. end
  3600.  
  3601. function library:settings(options)
  3602. local cfg = {
  3603. open = false;
  3604. items = {};
  3605. sanity = true; -- made this for my own sanity.
  3606. }
  3607.  
  3608. local items = cfg.items; do
  3609. items[ "outline" ] = library:create( "Frame" , {
  3610. Name = "\0";
  3611. Visible = true;
  3612. Parent = library[ "items" ];
  3613. BorderColor3 = rgb(0, 0, 0);
  3614. Size = dim2(0, 0, 0, 0);
  3615. ClipsDescendants = true;
  3616. BorderSizePixel = 0;
  3617. AutomaticSize = Enum.AutomaticSize.Y;
  3618. BackgroundColor3 = rgb(25, 25, 29)
  3619. });
  3620.  
  3621. items[ "inline" ] = library:create( "Frame" , {
  3622. Parent = items[ "outline" ];
  3623. Name = "\0";
  3624. Position = dim2(0, 1, 0, 1);
  3625. BorderColor3 = rgb(0, 0, 0);
  3626. Size = dim2(1, -2, 0, 0);
  3627. AutomaticSize = Enum.AutomaticSize.Y;
  3628. BorderSizePixel = 0;
  3629. BackgroundColor3 = rgb(22, 22, 24)
  3630. });
  3631.  
  3632. library:create( "UICorner" , {
  3633. Parent = items[ "inline" ];
  3634. CornerRadius = dim(0, 7)
  3635. });
  3636.  
  3637. items[ "elements" ] = library:create( "Frame" , {
  3638. BorderColor3 = rgb(0, 0, 0);
  3639. Parent = items[ "inline" ];
  3640. Name = "\0";
  3641. BackgroundTransparency = 1;
  3642. Position = dim2(0, 10, 0, 10);
  3643. Size = dim2(1, -20, 0, 0);
  3644. BorderSizePixel = 0;
  3645. AutomaticSize = Enum.AutomaticSize.Y;
  3646. BackgroundColor3 = rgb(255, 255, 255)
  3647. });
  3648.  
  3649. library:create( "UIListLayout" , {
  3650. Parent = items[ "elements" ];
  3651. Padding = dim(0, 10);
  3652. SortOrder = Enum.SortOrder.LayoutOrder
  3653. });
  3654.  
  3655. library:create( "UIPadding" , {
  3656. PaddingBottom = dim(0, 15);
  3657. Parent = items[ "elements" ]
  3658. });
  3659.  
  3660. library:create( "UICorner" , {
  3661. Parent = items[ "outline" ];
  3662. CornerRadius = dim(0, 7)
  3663. });
  3664.  
  3665. library:create( "UICorner" , {
  3666. Parent = items[ "fade" ];
  3667. CornerRadius = dim(0, 7)
  3668. });
  3669.  
  3670. items[ "tick" ] = library:create( "ImageButton" , {
  3671. Image = "rbxassetid://128797200442698";
  3672. Name = "\0";
  3673. AutoButtonColor = false;
  3674. Parent = self.items[ "right_components" ];
  3675. BorderColor3 = rgb(0, 0, 0);
  3676. Size = dim2(0, 16, 0, 16);
  3677. BorderSizePixel = 0;
  3678. BackgroundColor3 = rgb(255, 255, 255)
  3679. });
  3680. end
  3681.  
  3682. function cfg.set_visible(bool)
  3683. library:tween(items[ "outline" ], {Size = dim_offset(bool and 240 or 0, 0)})
  3684. items[ "outline" ].Position = dim_offset(items[ "tick" ].AbsolutePosition.X, items[ "tick" ].AbsolutePosition.Y + 90)
  3685. library:close_element(cfg)
  3686. end
  3687.  
  3688. items[ "tick" ].MouseButton1Click:Connect(function()
  3689. cfg.open = not cfg.open
  3690.  
  3691. cfg.set_visible(cfg.open)
  3692. end)
  3693.  
  3694. return setmetatable(cfg, library)
  3695. end
  3696.  
  3697. function library:list(properties)
  3698. local cfg = {
  3699. items = {};
  3700. options = properties.options or {"1", "2", "3"};
  3701. flag = properties.flag or library:next_flag();
  3702. callback = properties.callback or function() end;
  3703. data_store = {};
  3704. current_element;
  3705. }
  3706.  
  3707. local items = cfg.items; do
  3708. items[ "list" ] = library:create( "Frame" , {
  3709. Parent = self.items[ "elements" ];
  3710. BackgroundTransparency = 1;
  3711. Name = "\0";
  3712. Size = dim2(1, 0, 0, 0);
  3713. BorderColor3 = rgb(0, 0, 0);
  3714. BorderSizePixel = 0;
  3715. AutomaticSize = Enum.AutomaticSize.XY;
  3716. BackgroundColor3 = rgb(255, 255, 255)
  3717. });
  3718.  
  3719. library:create( "UIListLayout" , {
  3720. Parent = items[ "list" ];
  3721. Padding = dim(0, 10);
  3722. SortOrder = Enum.SortOrder.LayoutOrder
  3723. });
  3724.  
  3725. library:create( "UIPadding" , {
  3726. Parent = items[ "list" ];
  3727. PaddingRight = dim(0, 4);
  3728. PaddingLeft = dim(0, 4)
  3729. });
  3730. end
  3731.  
  3732. function cfg.refresh_options(options_to_refresh) -- ignore goofy parameter
  3733. for _,option in cfg.data_store do
  3734. option:Destroy()
  3735. end
  3736.  
  3737. for _, option_data in options_to_refresh do -- haha u skids no next >_<
  3738. local button = library:create( "TextButton" , {
  3739. FontFace = fonts.small;
  3740. TextColor3 = rgb(0, 0, 0);
  3741. BorderColor3 = rgb(0, 0, 0);
  3742. Text = "";
  3743. AutoButtonColor = false;
  3744. AnchorPoint = vec2(1, 0);
  3745. Parent = items[ "list" ];
  3746. Name = "\0";
  3747. Position = dim2(1, 0, 0, 0);
  3748. Size = dim2(1, 0, 0, 30);
  3749. BorderSizePixel = 0;
  3750. TextSize = 14;
  3751. BackgroundColor3 = rgb(33, 33, 35)
  3752. }); cfg.data_store[#cfg.data_store + 1] = button;
  3753.  
  3754. local name = library:create( "TextLabel" , {
  3755. FontFace = fonts.font;
  3756. TextColor3 = rgb(72, 72, 73);
  3757. BorderColor3 = rgb(0, 0, 0);
  3758. Text = option_data;
  3759. Parent = button;
  3760. Name = "\0";
  3761. BackgroundTransparency = 1;
  3762. Size = dim2(1, 0, 1, 0);
  3763. BorderSizePixel = 0;
  3764. AutomaticSize = Enum.AutomaticSize.XY;
  3765. TextSize = 14;
  3766. BackgroundColor3 = rgb(255, 255, 255)
  3767. });
  3768.  
  3769. library:create( "UICorner" , {
  3770. Parent = button;
  3771. CornerRadius = dim(0, 3)
  3772. });
  3773.  
  3774. button.MouseButton1Click:Connect(function()
  3775. local current = cfg.current_element
  3776. if current and current ~= name then
  3777. library:tween(current, {TextColor3 = rgb(72, 72, 72)})
  3778. end
  3779.  
  3780. flags[cfg.flag] = option_data
  3781. cfg.callback(option_data)
  3782. library:tween(name, {TextColor3 = rgb(245, 245, 245)})
  3783. cfg.current_element = name
  3784. end)
  3785.  
  3786. name.MouseEnter:Connect(function()
  3787. if cfg.current_element == name then
  3788. return
  3789. end
  3790.  
  3791. library:tween(name, {TextColor3 = rgb(140, 140, 140)})
  3792. end)
  3793.  
  3794. name.MouseLeave:Connect(function()
  3795. if cfg.current_element == name then
  3796. return
  3797. end
  3798.  
  3799. library:tween(name, {TextColor3 = rgb(72, 72, 72)})
  3800. end)
  3801. end
  3802. end
  3803.  
  3804. cfg.refresh_options(cfg.options)
  3805.  
  3806. return setmetatable(cfg, library)
  3807. end
  3808.  
  3809. function library:init_config(window)
  3810. window:seperator({name = "Settings"})
  3811. local main = window:tab({name = "Configs", tabs = {"Main"}})
  3812.  
  3813. local column = main:column({})
  3814. local section = column:section({name = "Configs", size = 1, default = true, icon = "rbxassetid://139628202576511"})
  3815. config_holder = section:list({options = {"Report", "This", "Error", "To", "Finobe"}, callback = function(option) end, flag = "config_name_list"}); library:update_config_list()
  3816.  
  3817. local column = main:column({})
  3818. local section = column:section({name = "Settings", side = "right", size = 1, default = true, icon = "rbxassetid://129380150574313"})
  3819. section:textbox({name = "Config name:", flag = "config_name_text"})
  3820. section:button({name = "Save", callback = function() writefile(library.directory .. "/configs/" .. flags["config_name_text"] or flags["config_name_list"] .. ".cfg", library:get_config()) library:update_config_list() notifications:create_notification({name = "Configs", info = "Saved config to:\n" .. flags["config_name_list"] or flags["config_name_text"]}) end})
  3821. section:button({name = "Load", callback = function() library:load_config(readfile(library.directory .. "/configs/" .. flags["config_name_list"] .. ".cfg")) library:update_config_list() notifications:create_notification({name = "Configs", info = "Loaded config:\n" .. flags["config_name_list"]}) end})
  3822. section:button({name = "Delete", callback = function() delfile(library.directory .. "/configs/" .. flags["config_name_list"] .. ".cfg") library:update_config_list() notifications:create_notification({name = "Configs", info = "Deleted config:\n" .. flags["config_name_list"]}) end})
  3823. section:colorpicker({name = "Menu Accent", callback = function(color, alpha) library:update_theme("accent", color) end, color = themes.preset.accent})
  3824. section:keybind({name = "Menu Bind", callback = function(bool) window.toggle_menu(bool) end, default = true})
  3825. end
  3826. --
  3827.  
  3828. function library:keysystem(options)
  3829. local cfg = {
  3830. title = options.title or "millenium",
  3831. subtitle = options.subtitle or "key system",
  3832. placeholder = options.placeholder or "enter your key...",
  3833. button_name = options.button_name or "Verify Key",
  3834. get_key_name = options.get_key_name or "Get Key",
  3835. get_key = options.get_key or "",
  3836. keys = options.keys or {},
  3837. validator = options.validator or nil,
  3838. onSuccess = options.onSuccess or function() end,
  3839. onFail = options.onFail or function() end,
  3840. }
  3841.  
  3842. -- Root GUI
  3843. local key_gui = library:create("ScreenGui", {
  3844. Parent = coregui;
  3845. Name = "\0";
  3846. ZIndexBehavior = Enum.ZIndexBehavior.Global;
  3847. IgnoreGuiInset = true;
  3848. Enabled = true;
  3849. })
  3850.  
  3851. -- Dark overlay
  3852. local overlay = library:create("Frame", {
  3853. Parent = key_gui;
  3854. Size = dim2(1, 0, 1, 0);
  3855. BackgroundColor3 = rgb(0, 0, 0);
  3856. BackgroundTransparency = 0.45;
  3857. BorderSizePixel = 0;
  3858. Name = "\0";
  3859. })
  3860.  
  3861. -- Dialog box (centered, 390 x 215)
  3862. local dialog = library:create("Frame", {
  3863. Parent = overlay;
  3864. Size = dim2(0, 390, 0, 260);
  3865. Position = dim2(0.5, -195, 0.5, -130);
  3866. BackgroundColor3 = rgb(14, 14, 16);
  3867. BorderSizePixel = 0;
  3868. Name = "\0";
  3869. })
  3870. library:create("UICorner", { Parent = dialog; CornerRadius = dim(0, 10) })
  3871. library:create("UIStroke", { Parent = dialog; Color = rgb(23, 23, 29); ApplyStrokeMode = Enum.ApplyStrokeMode.Border })
  3872.  
  3873. -- Header zone
  3874. local header = library:create("Frame", {
  3875. Parent = dialog;
  3876. Size = dim2(1, 0, 0, 58);
  3877. BackgroundTransparency = 1;
  3878. BorderSizePixel = 0;
  3879. Name = "\0";
  3880. })
  3881.  
  3882. -- Title label (accent)
  3883. local title_label = library:create("TextLabel", {
  3884. Parent = header;
  3885. Text = cfg.title;
  3886. FontFace = fonts.font;
  3887. TextColor3 = themes.preset.accent;
  3888. TextSize = 22;
  3889. Size = dim2(1, 0, 0, 30);
  3890. Position = dim2(0, 0, 0, 10);
  3891. BackgroundTransparency = 1;
  3892. TextXAlignment = Enum.TextXAlignment.Center;
  3893. BorderSizePixel = 0;
  3894. Name = "\0";
  3895. }); library:apply_theme(title_label, "accent", "TextColor3")
  3896.  
  3897. -- Subtitle label
  3898. library:create("TextLabel", {
  3899. Parent = header;
  3900. Text = cfg.subtitle;
  3901. FontFace = fonts.small;
  3902. TextColor3 = rgb(86, 86, 87);
  3903. TextSize = 13;
  3904. Size = dim2(1, 0, 0, 16);
  3905. Position = dim2(0, 0, 0, 36);
  3906. BackgroundTransparency = 1;
  3907. TextXAlignment = Enum.TextXAlignment.Center;
  3908. BorderSizePixel = 0;
  3909. Name = "\0";
  3910. })
  3911.  
  3912. -- Separator under header
  3913. library:create("Frame", {
  3914. Parent = dialog;
  3915. Position = dim2(0, 0, 0, 58);
  3916. Size = dim2(1, 0, 0, 1);
  3917. BackgroundColor3 = rgb(21, 21, 23);
  3918. BorderSizePixel = 0;
  3919. Name = "\0";
  3920. })
  3921.  
  3922. -- Content area
  3923. local content = library:create("Frame", {
  3924. Parent = dialog;
  3925. Position = dim2(0, 0, 0, 59);
  3926. Size = dim2(1, 0, 1, -59);
  3927. BackgroundTransparency = 1;
  3928. BorderSizePixel = 0;
  3929. Name = "\0";
  3930. })
  3931. library:create("UIPadding", {
  3932. Parent = content;
  3933. PaddingLeft = dim(0, 16);
  3934. PaddingRight = dim(0, 16);
  3935. PaddingTop = dim(0, 16);
  3936. PaddingBottom = dim(0, 12);
  3937. })
  3938. library:create("UIListLayout", {
  3939. Parent = content;
  3940. SortOrder = Enum.SortOrder.LayoutOrder;
  3941. Padding = dim(0, 10);
  3942. })
  3943.  
  3944. -- Key TextBox
  3945. local input_frame = library:create("Frame", {
  3946. Parent = content;
  3947. Size = dim2(1, 0, 0, 34);
  3948. BackgroundColor3 = rgb(33, 33, 35);
  3949. BorderSizePixel = 0;
  3950. LayoutOrder = 1;
  3951. Name = "\0";
  3952. })
  3953. library:create("UICorner", { Parent = input_frame; CornerRadius = dim(0, 5) })
  3954. local input_stroke = library:create("UIStroke", {
  3955. Parent = input_frame;
  3956. Color = rgb(44, 44, 46);
  3957. ApplyStrokeMode = Enum.ApplyStrokeMode.Border;
  3958. })
  3959.  
  3960. local key_input = library:create("TextBox", {
  3961. Parent = input_frame;
  3962. Size = dim2(1, -10, 1, 0);
  3963. Position = dim2(0, 5, 0, 0);
  3964. BackgroundTransparency = 1;
  3965. FontFace = fonts.small;
  3966. TextSize = 14;
  3967. TextColor3 = rgb(245, 245, 245);
  3968. PlaceholderText = cfg.placeholder;
  3969. PlaceholderColor3 = rgb(86, 86, 87);
  3970. ClearTextOnFocus = false;
  3971. Text = "";
  3972. BorderSizePixel = 0;
  3973. Name = "\0";
  3974. })
  3975.  
  3976. -- Verify button
  3977. local verify_btn = library:create("TextButton", {
  3978. Parent = content;
  3979. Size = dim2(1, 0, 0, 32);
  3980. BackgroundColor3 = themes.preset.accent;
  3981. BorderSizePixel = 0;
  3982. FontFace = fonts.small;
  3983. TextSize = 14;
  3984. TextColor3 = rgb(255, 255, 255);
  3985. Text = cfg.button_name;
  3986. AutoButtonColor = false;
  3987. LayoutOrder = 2;
  3988. Name = "\0";
  3989. }); library:apply_theme(verify_btn, "accent", "BackgroundColor3")
  3990. library:create("UICorner", { Parent = verify_btn; CornerRadius = dim(0, 5) })
  3991.  
  3992. -- Get Key button (copies input text to clipboard)
  3993. local getkey_btn = library:create("TextButton", {
  3994. Parent = content;
  3995. Size = dim2(1, 0, 0, 32);
  3996. BackgroundColor3 = rgb(33, 33, 35);
  3997. BorderSizePixel = 0;
  3998. FontFace = fonts.small;
  3999. TextSize = 14;
  4000. TextColor3 = rgb(200, 200, 200);
  4001. Text = cfg.get_key_name;
  4002. AutoButtonColor = false;
  4003. LayoutOrder = 3;
  4004. Name = "\0";
  4005. })
  4006. library:create("UICorner", { Parent = getkey_btn; CornerRadius = dim(0, 5) })
  4007. library:create("UIStroke", { Parent = getkey_btn; Color = rgb(44, 44, 46); ApplyStrokeMode = Enum.ApplyStrokeMode.Border })
  4008.  
  4009. -- Status label
  4010. local status_label = library:create("TextLabel", {
  4011. Parent = content;
  4012. Text = "";
  4013. FontFace = fonts.small;
  4014. TextSize = 13;
  4015. TextColor3 = rgb(200, 80, 80);
  4016. Size = dim2(1, 0, 0, 16);
  4017. BackgroundTransparency = 1;
  4018. TextXAlignment = Enum.TextXAlignment.Center;
  4019. BorderSizePixel = 0;
  4020. LayoutOrder = 4;
  4021. Name = "\0";
  4022. })
  4023.  
  4024. -- Get Key hover + click
  4025. getkey_btn.MouseEnter:Connect(function()
  4026. library:tween(getkey_btn, {BackgroundColor3 = rgb(44, 44, 46)})
  4027. end)
  4028. getkey_btn.MouseLeave:Connect(function()
  4029. library:tween(getkey_btn, {BackgroundColor3 = rgb(33, 33, 35)})
  4030. end)
  4031. getkey_btn.MouseButton1Click:Connect(function()
  4032. local txt = cfg.get_key
  4033. if txt == "" then return end
  4034. local ok = pcall(setclipboard, txt)
  4035. if not ok then pcall(toclipboard, txt) end
  4036. local prev = getkey_btn.Text
  4037. getkey_btn.Text = "Copied!"
  4038. library:tween(getkey_btn, {TextColor3 = rgb(80, 200, 120)})
  4039. task.wait(1.2)
  4040. getkey_btn.Text = prev
  4041. library:tween(getkey_btn, {TextColor3 = rgb(200, 200, 200)})
  4042. end)
  4043.  
  4044. -- Hover tint
  4045. verify_btn.MouseEnter:Connect(function()
  4046. library:tween(verify_btn, {BackgroundColor3 = rgb(170, 165, 230)})
  4047. end)
  4048. verify_btn.MouseLeave:Connect(function()
  4049. library:apply_theme(verify_btn, "accent", "BackgroundColor3")
  4050. library:tween(verify_btn, {BackgroundColor3 = themes.preset.accent})
  4051. end)
  4052.  
  4053. local function close_and_succeed()
  4054. library:tween(dialog, {Position = dim2(0.5, -195, 0.5, -80), BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4)
  4055. library:tween(overlay, {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4)
  4056. task.wait(0.45)
  4057. key_gui:Destroy()
  4058. cfg.onSuccess()
  4059. end
  4060.  
  4061. local function on_fail()
  4062. status_label.Text = "Invalid key."
  4063. library:tween(input_stroke, {Color = rgb(180, 60, 60)}, Enum.EasingStyle.Quad, 0.15)
  4064. task.wait(0.15)
  4065. library:tween(input_stroke, {Color = rgb(44, 44, 46)}, Enum.EasingStyle.Quad, 0.5)
  4066. library:tween(status_label, {TextColor3 = rgb(200, 80, 80)}, Enum.EasingStyle.Quad, 0.1)
  4067. cfg.onFail()
  4068. end
  4069.  
  4070. verify_btn.MouseButton1Click:Connect(function()
  4071. local entered = key_input.Text
  4072.  
  4073. local valid = false
  4074.  
  4075. if cfg.validator then
  4076. valid = cfg.validator(entered)
  4077. else
  4078. for _, k in cfg.keys do
  4079. if k == entered then
  4080. valid = true
  4081. break
  4082. end
  4083. end
  4084. end
  4085.  
  4086. if valid then
  4087. status_label.TextColor3 = rgb(80, 200, 120)
  4088. status_label.Text = "Key accepted!"
  4089. task.spawn(close_and_succeed)
  4090. else
  4091. task.spawn(on_fail)
  4092. end
  4093. end)
  4094.  
  4095. -- Allow Enter key to submit
  4096. key_input.FocusLost:Connect(function(enter_pressed)
  4097. if enter_pressed then
  4098. verify_btn.MouseButton1Click:Fire()
  4099. end
  4100. end)
  4101. end
  4102. -- Notification Library
  4103. function notifications:refresh_notifs()
  4104. local offset = 50
  4105.  
  4106. for i, v in notifications.notifs do
  4107. local Position = vec2(20, offset)
  4108. library:tween(v, {Position = dim_offset(Position.X, Position.Y)}, Enum.EasingStyle.Quad, 0.4)
  4109. offset += (v.AbsoluteSize.Y + 10)
  4110. end
  4111.  
  4112. return offset
  4113. end
  4114.  
  4115. function notifications:fade(path, is_fading)
  4116. local fading = is_fading and 1 or 0
  4117.  
  4118. library:tween(path, {BackgroundTransparency = fading}, Enum.EasingStyle.Quad, 1)
  4119.  
  4120. for _, instance in path:GetDescendants() do
  4121. if not instance:IsA("GuiObject") then
  4122. if instance:IsA("UIStroke") then
  4123. library:tween(instance, {Transparency = fading}, Enum.EasingStyle.Quad, 1)
  4124. end
  4125.  
  4126. continue
  4127. end
  4128.  
  4129. if instance:IsA("TextLabel") then
  4130. library:tween(instance, {TextTransparency = fading})
  4131. elseif instance:IsA("Frame") then
  4132. library:tween(instance, {BackgroundTransparency = instance.Transparency and 0.6 and is_fading and 1 or 0.6}, Enum.EasingStyle.Quad, 1)
  4133. end
  4134. end
  4135. end
  4136.  
  4137. function notifications:create_notification(options)
  4138. local cfg = {
  4139. name = options.name or "This is a title!";
  4140. info = options.info or "This is extra info!";
  4141. lifetime = options.lifetime or 3;
  4142. items = {};
  4143. outline;
  4144. }
  4145.  
  4146. local items = cfg.items; do
  4147. items[ "notification" ] = library:create( "Frame" , {
  4148. Parent = library[ "items" ];
  4149. Size = dim2(0, 210, 0, 53);
  4150. Name = "\0";
  4151. BorderColor3 = rgb(0, 0, 0);
  4152. BorderSizePixel = 0;
  4153. BackgroundTransparency = 1;
  4154. AnchorPoint = vec2(1, 0);
  4155. AutomaticSize = Enum.AutomaticSize.Y;
  4156. BackgroundColor3 = rgb(14, 14, 16)
  4157. });
  4158.  
  4159. library:create( "UIStroke" , {
  4160. Color = rgb(23, 23, 29);
  4161. Parent = items[ "notification" ];
  4162. Transparency = 1;
  4163. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  4164. });
  4165.  
  4166. items[ "title" ] = library:create( "TextLabel" , {
  4167. FontFace = fonts.font;
  4168. TextColor3 = rgb(255, 255, 255);
  4169. BorderColor3 = rgb(0, 0, 0);
  4170. Text = cfg.name;
  4171. Parent = items[ "notification" ];
  4172. Name = "\0";
  4173. BackgroundTransparency = 1;
  4174. Position = dim2(0, 7, 0, 6);
  4175. BorderSizePixel = 0;
  4176. AutomaticSize = Enum.AutomaticSize.XY;
  4177. TextSize = 14;
  4178. BackgroundColor3 = rgb(255, 255, 255)
  4179. });
  4180.  
  4181. library:create( "UICorner" , {
  4182. Parent = items[ "notification" ];
  4183. CornerRadius = dim(0, 3)
  4184. });
  4185.  
  4186. items[ "info" ] = library:create( "TextLabel" , {
  4187. FontFace = fonts.font;
  4188. TextColor3 = rgb(145, 145, 145);
  4189. BorderColor3 = rgb(0, 0, 0);
  4190. Text = cfg.info;
  4191. Parent = items[ "notification" ];
  4192. Name = "\0";
  4193. Position = dim2(0, 9, 0, 22);
  4194. BorderSizePixel = 0;
  4195. BackgroundTransparency = 1;
  4196. TextXAlignment = Enum.TextXAlignment.Left;
  4197. TextWrapped = true;
  4198. AutomaticSize = Enum.AutomaticSize.XY;
  4199. TextSize = 14;
  4200. BackgroundColor3 = rgb(255, 255, 255)
  4201. });
  4202.  
  4203. library:create( "UIPadding" , {
  4204. PaddingBottom = dim(0, 17);
  4205. PaddingRight = dim(0, 8);
  4206. Parent = items[ "info" ]
  4207. });
  4208.  
  4209. items[ "bar" ] = library:create( "Frame" , {
  4210. AnchorPoint = vec2(0, 1);
  4211. Parent = items[ "notification" ];
  4212. Name = "\0";
  4213. Position = dim2(0, 8, 1, -6);
  4214. BorderColor3 = rgb(0, 0, 0);
  4215. Size = dim2(0, 0, 0, 5);
  4216. BackgroundTransparency = 1;
  4217. BorderSizePixel = 0;
  4218. BackgroundColor3 = themes.preset.accent
  4219. });
  4220.  
  4221. library:create( "UICorner" , {
  4222. Parent = items[ "bar" ];
  4223. CornerRadius = dim(0, 999)
  4224. });
  4225.  
  4226. library:create( "UIPadding" , {
  4227. PaddingRight = dim(0, 8);
  4228. Parent = items[ "notification" ]
  4229. });
  4230. end
  4231.  
  4232. local index = #notifications.notifs + 1
  4233. notifications.notifs[index] = items[ "notification" ]
  4234.  
  4235. notifications:fade(items[ "notification" ], false)
  4236.  
  4237. local offset = notifications:refresh_notifs()
  4238.  
  4239. items[ "notification" ].Position = dim_offset(20, offset)
  4240.  
  4241. library:tween(items[ "notification" ], {AnchorPoint = vec2(0, 0)}, Enum.EasingStyle.Quad, 1)
  4242. library:tween(items[ "bar" ], {Size = dim2(1, -8, 0, 5)}, Enum.EasingStyle.Quad, cfg.lifetime)
  4243.  
  4244. task.spawn(function()
  4245. task.wait(cfg.lifetime)
  4246.  
  4247. notifications.notifs[index] = nil
  4248.  
  4249. notifications:fade(items[ "notification" ], true)
  4250.  
  4251. library:tween(items[ "notification" ], {AnchorPoint = vec2(1, 0)}, Enum.EasingStyle.Quad, 1)
  4252.  
  4253. task.wait(1)
  4254.  
  4255. items[ "notification" ]:Destroy()
  4256. end)
  4257. end
  4258. --
  4259. --
  4260.  
  4261. return library
RAW Paste Data Copied