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