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