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