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