--[[ Milenium Library -> Made by @finobe -> Kind of got bored idk what to do with life -> Idk who or why this got leaked, ui was VERY popular and high in demand with customers ]] -- Variables local uis = game:GetService("UserInputService") local players = game:GetService("Players") local ws = game:GetService("Workspace") local rs = game:GetService("ReplicatedStorage") local http_service = game:GetService("HttpService") local gui_service = game:GetService("GuiService") local lighting = game:GetService("Lighting") local run = game:GetService("RunService") local stats = game:GetService("Stats") local coregui = game:GetService("CoreGui") local debris = game:GetService("Debris") local tween_service = game:GetService("TweenService") local sound_service = game:GetService("SoundService") local vec2 = Vector2.new local vec3 = Vector3.new local dim2 = UDim2.new local dim = UDim.new local rect = Rect.new local cfr = CFrame.new local empty_cfr = cfr() local point_object_space = empty_cfr.PointToObjectSpace local angle = CFrame.Angles local dim_offset = UDim2.fromOffset local color = Color3.new local rgb = Color3.fromRGB local hex = Color3.fromHex local hsv = Color3.fromHSV local rgbseq = ColorSequence.new local rgbkey = ColorSequenceKeypoint.new local numseq = NumberSequence.new local numkey = NumberSequenceKeypoint.new local camera = ws.CurrentCamera local lp = players.LocalPlayer local mouse = lp:GetMouse() local gui_offset = gui_service:GetGuiInset().Y local rerun_key = "MilleniumUIManaged" local max = math.max local floor = math.floor local min = math.min local abs = math.abs local noise = math.noise local rad = math.rad local random = math.random local pow = math.pow local sin = math.sin local pi = math.pi local tan = math.tan local atan2 = math.atan2 local clamp = math.clamp local insert = table.insert local find = table.find local remove = table.remove local concat = table.concat -- -- Library init local previous_library = getgenv().library if type(previous_library) == "table" then pcall(function() if type(previous_library.unload_menu) == "function" then previous_library:unload_menu() end end) end for _, gui in coregui:GetChildren() do if gui:IsA("ScreenGui") and gui:GetAttribute(rerun_key) then gui:Destroy() end end getgenv().library = { directory = "milenium", folders = { "/fonts", "/configs", }, flags = {}, config_flags = {}, connections = {}, notifications = {notifs = {}}, current_open; } local library = getgenv().library local themes = { preset = { accent = rgb(155, 150, 219), }, utility = { accent = { BackgroundColor3 = {}, TextColor3 = {}, ImageColor3 = {}, ScrollBarImageColor3 = {} }, } } local keys = { [Enum.KeyCode.LeftShift] = "LS", [Enum.KeyCode.RightShift] = "RS", [Enum.KeyCode.LeftControl] = "LC", [Enum.KeyCode.RightControl] = "RC", [Enum.KeyCode.Insert] = "INS", [Enum.KeyCode.Backspace] = "BS", [Enum.KeyCode.Return] = "Ent", [Enum.KeyCode.LeftAlt] = "LA", [Enum.KeyCode.RightAlt] = "RA", [Enum.KeyCode.CapsLock] = "CAPS", [Enum.KeyCode.One] = "1", [Enum.KeyCode.Two] = "2", [Enum.KeyCode.Three] = "3", [Enum.KeyCode.Four] = "4", [Enum.KeyCode.Five] = "5", [Enum.KeyCode.Six] = "6", [Enum.KeyCode.Seven] = "7", [Enum.KeyCode.Eight] = "8", [Enum.KeyCode.Nine] = "9", [Enum.KeyCode.Zero] = "0", [Enum.KeyCode.KeypadOne] = "Num1", [Enum.KeyCode.KeypadTwo] = "Num2", [Enum.KeyCode.KeypadThree] = "Num3", [Enum.KeyCode.KeypadFour] = "Num4", [Enum.KeyCode.KeypadFive] = "Num5", [Enum.KeyCode.KeypadSix] = "Num6", [Enum.KeyCode.KeypadSeven] = "Num7", [Enum.KeyCode.KeypadEight] = "Num8", [Enum.KeyCode.KeypadNine] = "Num9", [Enum.KeyCode.KeypadZero] = "Num0", [Enum.KeyCode.Minus] = "-", [Enum.KeyCode.Equals] = "=", [Enum.KeyCode.Tilde] = "~", [Enum.KeyCode.LeftBracket] = "[", [Enum.KeyCode.RightBracket] = "]", [Enum.KeyCode.RightParenthesis] = ")", [Enum.KeyCode.LeftParenthesis] = "(", [Enum.KeyCode.Semicolon] = ",", [Enum.KeyCode.Quote] = "'", [Enum.KeyCode.BackSlash] = "\\", [Enum.KeyCode.Comma] = ",", [Enum.KeyCode.Period] = ".", [Enum.KeyCode.Slash] = "/", [Enum.KeyCode.Asterisk] = "*", [Enum.KeyCode.Plus] = "+", [Enum.KeyCode.Period] = ".", [Enum.KeyCode.Backquote] = "`", [Enum.UserInputType.MouseButton1] = "MB1", [Enum.UserInputType.MouseButton2] = "MB2", [Enum.UserInputType.MouseButton3] = "MB3", [Enum.KeyCode.Escape] = "ESC", [Enum.KeyCode.Space] = "SPC", } library.__index = library for _, path in next, library.folders do makefolder(library.directory .. path) end local flags = library.flags local config_flags = library.config_flags local notifications = library.notifications local fonts = {}; do function Register_Font(Name, Weight, Style, Asset) if not isfile(Asset.Id) then writefile(Asset.Id, Asset.Font) end if isfile(Name .. ".font") then delfile(Name .. ".font") end local Data = { name = Name, faces = { { name = "Normal", weight = Weight, style = Style, assetId = getcustomasset(Asset.Id), }, }, } writefile(Name .. ".font", http_service:JSONEncode(Data)) return getcustomasset(Name .. ".font"); end local Medium = Register_Font("Medium", 200, "Normal", { Id = "Medium.ttf", Font = game:HttpGet("https://github.com/i77lhm/storage/raw/refs/heads/main/fonts/Inter_28pt-Medium.ttf"), }) local SemiBold = Register_Font("SemiBold", 200, "Normal", { Id = "SemiBold.ttf", Font = game:HttpGet("https://github.com/i77lhm/storage/raw/refs/heads/main/fonts/Inter_28pt-SemiBold.ttf"), }) fonts = { small = Font.new(Medium, Enum.FontWeight.Regular, Enum.FontStyle.Normal); font = Font.new(SemiBold, Enum.FontWeight.Regular, Enum.FontStyle.Normal); } end -- -- Library functions -- Misc functions function library:tween(obj, properties, easing_style, time) 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() return tween end function library:resizify(frame) local Frame = Instance.new("TextButton") Frame.Position = dim2(1, -10, 1, -10) Frame.BorderColor3 = rgb(0, 0, 0) Frame.Size = dim2(0, 10, 0, 10) Frame.BorderSizePixel = 0 Frame.BackgroundColor3 = rgb(255, 255, 255) Frame.Parent = frame Frame.BackgroundTransparency = 1 Frame.Text = "" local resizing = false local start_size local start local og_size = frame.Size Frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing = true start = input.Position start_size = frame.Size end end) Frame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing = false end end) library:connection(uis.InputChanged, function(input, game_event) if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then local viewport_x = camera.ViewportSize.X local viewport_y = camera.ViewportSize.Y local current_size = dim2( start_size.X.Scale, math.clamp( start_size.X.Offset + (input.Position.X - start.X), og_size.X.Offset, viewport_x ), start_size.Y.Scale, math.clamp( start_size.Y.Offset + (input.Position.Y - start.Y), og_size.Y.Offset, viewport_y ) ) library:tween(frame, {Size = current_size}, Enum.EasingStyle.Linear, 0.05) end end) end function fag(tbl) local Size = 0 for _ in tbl do Size = Size + 1 end return Size end function library:next_flag() local index = fag(library.flags) + 1; local str = string.format("flagnumber%s", index) return str; end function library:mouse_in_frame(uiobject) local y_cond = uiobject.AbsolutePosition.Y <= mouse.Y and mouse.Y <= uiobject.AbsolutePosition.Y + uiobject.AbsoluteSize.Y local x_cond = uiobject.AbsolutePosition.X <= mouse.X and mouse.X <= uiobject.AbsolutePosition.X + uiobject.AbsoluteSize.X return (y_cond and x_cond) end function library:draggify(frame) local dragging = false local start_size = frame.Position local start frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true start = input.Position start_size = frame.Position end end) frame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) library:connection(uis.InputChanged, function(input, game_event) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local viewport_x = camera.ViewportSize.X local viewport_y = camera.ViewportSize.Y local current_position = dim2( 0, clamp( start_size.X.Offset + (input.Position.X - start.X), 0, viewport_x - frame.Size.X.Offset ), 0, math.clamp( start_size.Y.Offset + (input.Position.Y - start.Y), 0, viewport_y - frame.Size.Y.Offset ) ) library:tween(frame, {Position = current_position}, Enum.EasingStyle.Linear, 0.05) library:close_element() end end) end function library:convert(str) local values = {} for value in string.gmatch(str, "[^,]+") do insert(values, tonumber(value)) end if #values == 4 then return unpack(values) else return end end function library:convert_enum(enum) local enum_parts = {} for part in string.gmatch(enum, "[%w_]+") do insert(enum_parts, part) end local enum_table = Enum for i = 2, #enum_parts do local enum_item = enum_table[enum_parts[i]] enum_table = enum_item end return enum_table end local config_holder; function library:update_config_list() if not config_holder then return end local list = {} for idx, file in listfiles(library.directory .. "/configs") do local name = file:gsub(library.directory .. "/configs\\", ""):gsub(".cfg", ""):gsub(library.directory .. "\\configs\\", "") list[#list + 1] = name end config_holder.refresh_options(list) end function library:get_config() local Config = {} for _, v in next, flags do if type(v) == "table" and v.key then Config[_] = {active = v.active, mode = v.mode, key = tostring(v.key)} elseif type(v) == "table" and v["Transparency"] and v["Color"] then Config[_] = {Transparency = v["Transparency"], Color = v["Color"]:ToHex()} else Config[_] = v end end return http_service:JSONEncode(Config) end function library:load_config(config_json) local config = http_service:JSONDecode(config_json) for _, v in config do local function_set = library.config_flags[_] if _ ~= "config_name_list" and function_set then if type(v) == "table" and v["Transparency"] and v["Color"] then function_set(hex(v["Color"]), v["Transparency"]) elseif type(v) == "table" and v["active"] then function_set(v) else function_set(v) end end end end function library:round(number, float) local multiplier = 1 / (float or 1) return floor(number * multiplier + 0.5) / multiplier end function library:apply_theme(instance, theme, property) insert(themes.utility[theme][property], instance) end function library:update_theme(theme, color) for _, property in themes.utility[theme] do for m, object in property do if object[_] == themes.preset[theme] then object[_] = color end end end themes.preset[theme] = color end function library:connection(signal, callback) local connection = signal:Connect(callback) insert(library.connections, connection) return connection end function library:close_element(new_path) local open_element = library.current_open if open_element and new_path ~= open_element then open_element.set_visible(false) open_element.open = false; end if new_path ~= open_element then library.current_open = new_path or nil; end end function library:create(instance, options) local ins = Instance.new(instance) for prop, value in options do ins[prop] = value end return ins end function library:unload_menu() local current_library = library if not current_library or current_library.is_unloading then return end current_library.is_unloading = true current_library.destroyed = true current_library.current_open = nil for index, connection in current_library.connections do pcall(function() if connection then connection:Disconnect() end end) current_library.connections[index] = nil end local cleanup_instances = { current_library[ "key_gui" ], current_library[ "other" ], current_library[ "items" ], } for _, instance in cleanup_instances do pcall(function() if instance then instance:Destroy() end end) end for _, gui in coregui:GetChildren() do if gui:IsA("ScreenGui") and gui:GetAttribute(rerun_key) then gui:Destroy() end end current_library.items = nil current_library.other = nil current_library.key_gui = nil current_library.flags = {} current_library.config_flags = {} current_library.notifications = {notifs = {}} current_library.connections = {} if getgenv().library == current_library then getgenv().library = nil end end -- -- Library element functions function library:window(properties) local cfg = { suffix = properties.suffix or properties.Suffix or "tech"; name = properties.name or properties.Name or "nebula"; game_name = properties.gameInfo or properties.game_info or properties.GameInfo or "Milenium for Counter-Strike: Global Offensive"; 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; size = properties.size or properties.Size or dim2(0, 944, 0, 648); selected_tab; items = {}; tween; } library[ "items" ] = library:create( "ScreenGui" , { Parent = coregui; Name = "\0"; Enabled = true; ZIndexBehavior = Enum.ZIndexBehavior.Global; IgnoreGuiInset = true; }); library[ "items" ]:SetAttribute(rerun_key, true) library[ "other" ] = library:create( "ScreenGui" , { Parent = coregui; Name = "\0"; Enabled = false; ZIndexBehavior = Enum.ZIndexBehavior.Sibling; IgnoreGuiInset = true; }); library[ "other" ]:SetAttribute(rerun_key, true) local items = cfg.items; do items[ "main" ] = library:create( "Frame" , { Parent = library[ "items" ]; Size = cfg.size; Name = "\0"; Position = dim2(0.5, -cfg.size.X.Offset / 2, 0.5, -cfg.size.Y.Offset / 2); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(14, 14, 16) }); items[ "main" ].Position = dim2(0, items[ "main" ].AbsolutePosition.X, 0, items[ "main" ].AbsolutePosition.Y) library:create( "UICorner" , { Parent = items[ "main" ]; CornerRadius = dim(0, 10) }); library:create( "UIStroke" , { Color = rgb(23, 23, 29); Parent = items[ "main" ]; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); items[ "side_frame" ] = library:create( "Frame" , { Parent = items[ "main" ]; BackgroundTransparency = 1; Name = "\0"; BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 196, 1, -25); BorderSizePixel = 0; BackgroundColor3 = rgb(14, 14, 16) }); library:create( "Frame" , { AnchorPoint = vec2(1, 0); Parent = items[ "side_frame" ]; Position = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 1, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(21, 21, 23) }); items[ "button_holder" ] = library:create( "Frame" , { Parent = items[ "side_frame" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 0, 0, 60); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 1, -60); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); cfg.button_holder = items[ "button_holder" ]; library:create( "UIListLayout" , { Parent = items[ "button_holder" ]; Padding = dim(0, 5); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { PaddingTop = dim(0, 16); PaddingBottom = dim(0, 36); Parent = items[ "button_holder" ]; PaddingRight = dim(0, 11); PaddingLeft = dim(0, 10) }); local accent = themes.preset.accent items[ "title" ] = library:create( "TextLabel" , { FontFace = fonts.font; BorderColor3 = rgb(0, 0, 0); Text = name; Parent = items[ "side_frame" ]; Name = "\0"; Text = string.format('%s%s', cfg.name, cfg.suffix); BackgroundTransparency = 1; Size = dim2(1, 0, 0, 70); TextColor3 = themes.preset.accent; BorderSizePixel = 0; RichText = true; TextSize = 30; BackgroundColor3 = rgb(255, 255, 255) }); library:apply_theme(items[ "title" ], "accent", "TextColor3"); if cfg.image and tostring(cfg.image) ~= "" then local image_id = tostring(cfg.image) if image_id:match("^%d+$") then image_id = "rbxassetid://" .. image_id end items[ "title_icon_holder" ] = library:create( "Frame" , { Parent = items[ "side_frame" ]; Name = "\0"; Position = dim2(0, 10, 0, 12); Size = dim2(0, 46, 0, 46); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(19, 19, 21) }); library:create( "UICorner" , { Parent = items[ "title_icon_holder" ]; CornerRadius = dim(0, 8) }); library:create( "UIStroke" , { Color = rgb(23, 23, 29); Parent = items[ "title_icon_holder" ]; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); items[ "title_icon" ] = library:create( "ImageLabel" , { Parent = items[ "title_icon_holder" ]; Name = "\0"; Position = dim2(0, 6, 0, 6); Size = dim2(1, -12, 1, -12); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundTransparency = 1; BackgroundColor3 = rgb(255, 255, 255); Image = image_id; ScaleType = Enum.ScaleType.Fit }); items[ "title" ].Position = dim2(0, 62, 0, 0) items[ "title" ].Size = dim2(1, -72, 0, 70) items[ "title" ].TextXAlignment = Enum.TextXAlignment.Left end items[ "multi_holder" ] = library:create( "Frame" , { Parent = items[ "main" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 196, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -196, 0, 56); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); cfg.multi_holder = items[ "multi_holder" ]; library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = items[ "multi_holder" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(21, 21, 23) }); items[ "shadow" ] = library:create( "ImageLabel" , { ImageColor3 = rgb(0, 0, 0); ScaleType = Enum.ScaleType.Slice; Parent = items[ "main" ]; BorderColor3 = rgb(0, 0, 0); Name = "\0"; BackgroundColor3 = rgb(255, 255, 255); Size = dim2(1, 75, 1, 75); AnchorPoint = vec2(0.5, 0.5); Image = "rbxassetid://112971167999062"; BackgroundTransparency = 1; Position = dim2(0.5, 0, 0.5, 0); SliceScale = 0.75; ZIndex = -100; BorderSizePixel = 0; SliceCenter = rect(vec2(112, 112), vec2(147, 147)) }); items[ "global_fade" ] = library:create( "Frame" , { Parent = items[ "main" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 196, 0, 56); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -196, 1, -81); BorderSizePixel = 0; BackgroundColor3 = rgb(14, 14, 16); ZIndex = 2; }); library:create( "UICorner" , { Parent = items[ "shadow" ]; CornerRadius = dim(0, 5) }); items[ "info" ] = library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = items[ "main" ]; Name = "\0"; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 25); BorderSizePixel = 0; BackgroundColor3 = rgb(23, 23, 25) }); library:create( "UICorner" , { Parent = items[ "info" ]; CornerRadius = dim(0, 10) }); items[ "grey_fill" ] = library:create( "Frame" , { Name = "\0"; Parent = items[ "info" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 6); BorderSizePixel = 0; BackgroundColor3 = rgb(23, 23, 25) }); items[ "game" ] = library:create( "TextLabel" , { FontFace = fonts.font; Parent = items[ "info" ]; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = cfg.game_name; Name = "\0"; Size = dim2(1, 0, 0, 0); AnchorPoint = vec2(0, 0.5); Position = dim2(0, 10, 0.5, -1); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "other_info" ] = library:create( "TextLabel" , { Parent = items[ "info" ]; RichText = true; Name = "\0"; TextColor3 = themes.preset.accent; BorderColor3 = rgb(0, 0, 0); Text = '32 days left, ' .. cfg.name .. cfg.suffix; Size = dim2(1, 0, 0, 0); Position = dim2(0, -10, 0.5, -1); AnchorPoint = vec2(0, 0.5); BorderSizePixel = 0; BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Right; AutomaticSize = Enum.AutomaticSize.XY; FontFace = fonts.font; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:apply_theme(items[ "other_info" ], "accent", "TextColor3"); end do -- Other library:draggify(items[ "main" ]) library:resizify(items[ "main" ]) end function cfg.toggle_menu(bool) -- WIP -- if cfg.tween then -- cfg.tween:Cancel() -- end -- 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) -- library:tween(items[ "tab_holder" ], {Size = dim2(1, -196, 1, -81)}, Enum.EasingStyle.Quad, 0.4) -- cfg.tween = library[ "items" ].Enabled = bool end return setmetatable(cfg, library) end function library:tab(properties) local cfg = { name = properties.name or properties.Name or "visuals"; icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6034767608"; -- multi tabs = properties.tabs or properties.Tabs or {"Main", "Misc.", "Settings"}; pages = {}; -- data store for multi sections current_multi; items = {}; } local items = cfg.items; do items[ "tab_holder" ] = library:create( "Frame" , { Parent = library.cache; Name = "\0"; Visible = false; BackgroundTransparency = 1; Position = dim2(0, 196, 0, 56); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -216, 1, -101); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); -- Tab buttons items[ "button" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "button_holder" ]; AutoButtonColor = false; BackgroundTransparency = 1; Name = "\0"; Size = dim2(1, 0, 0, 35); BorderSizePixel = 0; TextSize = 16; BackgroundColor3 = rgb(29, 29, 29) }); items[ "icon" ] = library:create( "ImageLabel" , { ImageColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Parent = items[ "button" ]; AnchorPoint = vec2(0, 0.5); Image = "http://www.roblox.com/asset/?id=6034767608"; BackgroundTransparency = 1; Position = dim2(0, 10, 0.5, 0); Name = "\0"; Size = dim2(0, 22, 0, 22); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:apply_theme(items[ "icon" ], "accent", "ImageColor3"); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "button" ]; Name = "\0"; Size = dim2(0, 0, 1, 0); Position = dim2(0, 40, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.X; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); library:create( "UICorner" , { Parent = items[ "button" ]; CornerRadius = dim(0, 7) }); library:create( "UIStroke" , { Color = rgb(23, 23, 29); Parent = items[ "button" ]; Enabled = false; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); -- -- Multi Sections items[ "multi_section_button_holder" ] = library:create( "Frame" , { Parent = library.cache; BackgroundTransparency = 1; Name = "\0"; Visible = false; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "multi_section_button_holder" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder; FillDirection = Enum.FillDirection.Horizontal }); library:create( "UIPadding" , { PaddingTop = dim(0, 8); PaddingBottom = dim(0, 7); Parent = items[ "multi_section_button_holder" ]; PaddingRight = dim(0, 7); PaddingLeft = dim(0, 7) }); for _, section in cfg.tabs do local data = {items = {}} local multi_items = data.items; do -- Button multi_items[ "button" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); AutoButtonColor = false; Text = ""; Parent = items[ "multi_section_button_holder" ]; Name = "\0"; Size = dim2(0, 0, 0, 39); BackgroundTransparency = 1; ClipsDescendants = true; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.X; TextSize = 16; BackgroundColor3 = rgb(25, 25, 29) }); multi_items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(62, 62, 63); BorderColor3 = rgb(0, 0, 0); Text = section; Parent = multi_items[ "button" ]; Name = "\0"; Size = dim2(0, 0, 1, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = multi_items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); multi_items[ "accent" ] = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); AnchorPoint = vec2(0, 1); Parent = multi_items[ "button" ]; BackgroundTransparency = 1; Position = dim2(0, 10, 1, 4); Name = "\0"; Size = dim2(1, -20, 0, 6); BorderSizePixel = 0; BackgroundColor3 = themes.preset.accent }); library:apply_theme(multi_items[ "accent" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = multi_items[ "accent" ]; CornerRadius = dim(0, 999) }); library:create( "UIPadding" , { Parent = multi_items[ "button" ]; PaddingRight = dim(0, 10); PaddingLeft = dim(0, 10) }); library:create( "UICorner" , { Parent = multi_items[ "button" ]; CornerRadius = dim(0, 7) }); -- -- Tab multi_items[ "tab" ] = library:create( "ScrollingFrame" , { Parent = library.cache; ScrollBarImageColor3 = rgb(44, 44, 46); Active = true; AutomaticCanvasSize = Enum.AutomaticSize.Y; ScrollBarThickness = 2; BackgroundTransparency = 1; Name = "\0"; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -20, 1, -20); CanvasSize = dim2(0, 0, 0, 0); BorderSizePixel = 0; Visible = false; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { FillDirection = Enum.FillDirection.Vertical; HorizontalFlex = Enum.UIFlexAlignment.Fill; Parent = multi_items[ "tab" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { PaddingTop = dim(0, 7); PaddingBottom = dim(0, 7); Parent = multi_items[ "tab" ]; PaddingRight = dim(0, 7); PaddingLeft = dim(0, 7) }); -- end data.text = multi_items[ "name" ] data.accent = multi_items[ "accent" ] data.button = multi_items[ "button" ] data.page = multi_items[ "tab" ] data.parent = setmetatable(data, library):sub_tab({}).items[ "tab_parent" ] -- Old column code -- data.left = multi_items[ "left" ] -- data.right = multi_items[ "right" ] function data.open_page() local page = cfg.current_multi; if page and page.text ~= data.text then self.items[ "global_fade" ].BackgroundTransparency = 0 library:tween(self.items[ "global_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4) local old_size = page.page.Size page.page.Size = dim2(1, -20, 1, -20) end if page then library:tween(page.text, {TextColor3 = rgb(62, 62, 63)}) library:tween(page.accent, {BackgroundTransparency = 1}) library:tween(page.button, {BackgroundTransparency = 1}) page.page.Visible = false page.page.Parent = library[ "cache" ] end library:tween(data.text, {TextColor3 = rgb(255, 255, 255)}) library:tween(data.accent, {BackgroundTransparency = 0}) library:tween(data.button, {BackgroundTransparency = 0}) library:tween(data.page, {Size = dim2(1, 0, 1, 0)}, Enum.EasingStyle.Quad, 0.4) data.page.Visible = true data.page.Parent = items["tab_holder"] cfg.current_multi = data library:close_element() end multi_items[ "button" ].MouseButton1Down:Connect(function() data.open_page() end) cfg.pages[#cfg.pages + 1] = setmetatable(data, library) end cfg.pages[1].open_page() -- end function cfg.open_tab() local selected_tab = self.selected_tab if selected_tab then if selected_tab[ 4 ] ~= items[ "tab_holder" ] then self.items[ "global_fade" ].BackgroundTransparency = 0 library:tween(self.items[ "global_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4) selected_tab[ 4 ].Size = dim2(1, -216, 1, -101) end library:tween(selected_tab[ 1 ], {BackgroundTransparency = 1}) library:tween(selected_tab[ 2 ], {ImageColor3 = rgb(72, 72, 73)}) library:tween(selected_tab[ 3 ], {TextColor3 = rgb(72, 72, 73)}) selected_tab[ 4 ].Visible = false selected_tab[ 4 ].Parent = library[ "cache" ] selected_tab[ 5 ].Visible = false selected_tab[ 5 ].Parent = library[ "cache" ] end library:tween(items[ "button" ], {BackgroundTransparency = 0}) library:tween(items[ "icon" ], {ImageColor3 = themes.preset.accent}) library:tween(items[ "name" ], {TextColor3 = rgb(255, 255, 255)}) library:tween(items[ "tab_holder" ], {Size = dim2(1, -196, 1, -81)}, Enum.EasingStyle.Quad, 0.4) items[ "tab_holder" ].Visible = true items[ "tab_holder" ].Parent = self.items[ "main" ] items[ "multi_section_button_holder" ].Visible = true items[ "multi_section_button_holder" ].Parent = self.items[ "multi_holder" ] self.selected_tab = { items[ "button" ]; items[ "icon" ]; items[ "name" ]; items[ "tab_holder" ]; items[ "multi_section_button_holder" ]; } library:close_element() end items[ "button" ].MouseButton1Down:Connect(function() cfg.open_tab() end) if not self.selected_tab then cfg.open_tab(true) end return unpack(cfg.pages) end function library:seperator(properties) local cfg = {items = {}, name = properties.Name or properties.name or "General"} local items = cfg.items do items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = self.items[ "button_holder" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); Position = dim2(0, 40, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); end; return setmetatable(cfg, library) end -- Miscellaneous function library:column(properties) local cfg = {items = {}, size = properties.size or 1} local items = cfg.items; do items[ "column" ] = library:create( "Frame" , { Parent = self[ "parent" ] or self.items["tab_parent"]; BackgroundTransparency = 1; Name = "\0"; BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { PaddingBottom = dim(0, 10); Parent = items[ "column" ] }); library:create( "UIListLayout" , { Parent = items[ "column" ]; HorizontalFlex = Enum.UIFlexAlignment.Fill; Padding = dim(0, 10); FillDirection = Enum.FillDirection.Vertical; SortOrder = Enum.SortOrder.LayoutOrder }); end return setmetatable(cfg, library) end function library:sub_tab(properties) local cfg = {items = {}, order = properties.order or 0; size = properties.size or 1} local items = cfg.items; do items[ "tab_parent" ] = library:create( "Frame" , { Parent = self.items[ "tab" ]; BackgroundTransparency = 1; Name = "\0"; LayoutOrder = cfg.order; Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; Visible = true; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { FillDirection = Enum.FillDirection.Horizontal; HorizontalFlex = Enum.UIFlexAlignment.Fill; Parent = items[ "tab_parent" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder; }); end return setmetatable(cfg, library) end -- function library:section(properties) local cfg = { name = properties.name or properties.Name or "section"; side = properties.side or properties.Side or "left"; default = properties.default or properties.Default or false; size = properties.size or properties.Size or self.size or 0.5; icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6022668898"; fading_toggle = properties.fading or properties.Fading or false; items = {}; }; local items = cfg.items; do items[ "outline" ] = library:create( "Frame" , { Name = "\0"; Parent = self.items[ "column" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(25, 25, 29) }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 7) }); items[ "inline" ] = library:create( "Frame" , { Parent = items[ "outline" ]; Name = "\0"; Position = dim2(0, 1, 0, 1); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -2, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:create( "UICorner" , { Parent = items[ "inline" ]; CornerRadius = dim(0, 7) }); items[ "scrolling" ] = library:create( "Frame" , { Parent = items[ "inline" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BackgroundTransparency = 1; Position = dim2(0, 0, 0, 35); BackgroundColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0 }); items[ "elements" ] = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); Parent = items[ "scrolling" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 10, 0, 10); Size = dim2(1, -20, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "elements" ]; Padding = dim(0, 10); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { PaddingBottom = dim(0, 15); Parent = items[ "elements" ] }); items[ "button" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; Parent = items[ "outline" ]; Name = "\0"; Position = dim2(0, 1, 0, 1); Size = dim2(1, -2, 0, 35); BorderSizePixel = 0; TextSize = 16; BackgroundColor3 = rgb(19, 19, 21) }); library:create( "UIStroke" , { Color = rgb(23, 23, 29); Parent = items[ "button" ]; Enabled = false; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); library:create( "UICorner" , { Parent = items[ "button" ]; CornerRadius = dim(0, 7) }); items[ "Icon" ] = library:create( "ImageLabel" , { ImageColor3 = themes.preset.accent; BorderColor3 = rgb(0, 0, 0); Parent = items[ "button" ]; AnchorPoint = vec2(0, 0.5); Image = cfg.icon; BackgroundTransparency = 1; Position = dim2(0, 10, 0.5, 0); Name = "\0"; Size = dim2(0, 22, 0, 22); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:apply_theme(items[ "Icon" ], "accent", "ImageColor3"); items[ "section_title" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "button" ]; Name = "\0"; Size = dim2(0, 0, 1, 0); Position = dim2(0, 40, 0, -1); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.X; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = items[ "button" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); if cfg.fading_toggle then items[ "toggle" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); AutoButtonColor = false; Text = ""; AnchorPoint = vec2(1, 0.5); Parent = items[ "button" ]; Name = "\0"; Position = dim2(1, -9, 0.5, 0); Size = dim2(0, 36, 0, 18); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(58, 58, 62) }); library:apply_theme(items[ "toggle" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "toggle" ]; CornerRadius = dim(0, 999) }); items[ "toggle_outline" ] = library:create( "Frame" , { Parent = items[ "toggle" ]; Size = dim2(1, -2, 1, -2); Name = "\0"; BorderMode = Enum.BorderMode.Inset; BorderColor3 = rgb(0, 0, 0); Position = dim2(0, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(50, 50, 50) }); library:apply_theme(items[ "toggle_outline" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "toggle_outline" ]; CornerRadius = dim(0, 999) }); library:create( "UIGradient" , { Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))}; Parent = items[ "toggle_outline" ] }); items[ "toggle_circle" ] = library:create( "Frame" , { Parent = items[ "toggle_outline" ]; Name = "\0"; Position = dim2(0, 2, 0, 2); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 12, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(86, 86, 88) }); library:create( "UICorner" , { Parent = items[ "toggle_circle" ]; CornerRadius = dim(0, 999) }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 7) }); items[ "fade" ] = library:create( "Frame" , { Parent = items[ "outline" ]; BackgroundTransparency = 0.800000011920929; Name = "\0"; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(0, 0, 0) }); library:create( "UICorner" , { Parent = items[ "fade" ]; CornerRadius = dim(0, 7) }); end end; if cfg.fading_toggle then items[ "button" ].MouseButton1Click:Connect(function() cfg.default = not cfg.default cfg.toggle_section(cfg.default) end) function cfg.toggle_section(bool) library:tween(items[ "toggle" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(58, 58, 62)}, Enum.EasingStyle.Quad) library:tween(items[ "toggle_outline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(50, 50, 50)}, Enum.EasingStyle.Quad) 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) library:tween(items[ "fade" ], {BackgroundTransparency = bool and 1 or 0.8}, Enum.EasingStyle.Quad) end end return setmetatable(cfg, library) end function library:tabbox(properties) local cfg = { name = properties.name or properties.Name or "Tabbox"; tabs = properties.tabs or properties.Tabs or {"Tab 1", "Tab 2"}; size = properties.size or properties.Size or self.size or 0.5; icon = properties.icon or properties.Icon or "http://www.roblox.com/asset/?id=6022668898"; items = {}; pages = {}; current_tab = nil; } local items = cfg.items; do items[ "outline" ] = library:create( "Frame" , { Name = "\0"; Parent = self.items[ "column" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(25, 25, 29) }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 7) }); items[ "inline" ] = library:create( "Frame" , { Parent = items[ "outline" ]; Name = "\0"; Position = dim2(0, 1, 0, 1); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -2, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:create( "UICorner" , { Parent = items[ "inline" ]; CornerRadius = dim(0, 7) }); items[ "tab_bar" ] = library:create( "Frame" , { Parent = items[ "inline" ]; Name = "\0"; Position = dim2(0, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 35); BorderSizePixel = 0; BackgroundColor3 = rgb(19, 19, 21) }); library:create( "UICorner" , { Parent = items[ "tab_bar" ]; CornerRadius = dim(0, 7) }); library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = items[ "tab_bar" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); items[ "content" ] = library:create( "Frame" , { Parent = items[ "inline" ]; Name = "\0"; Position = dim2(0, 0, 0, 35); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundTransparency = 1; BackgroundColor3 = rgb(255, 255, 255) }); local total_tabs = #cfg.tabs for i = 1, total_tabs do local tab_name = cfg.tabs[i] local page = {items = {}} local btn = library:create( "TextButton" , { FontFace = fonts.font; Text = ""; Parent = items[ "tab_bar" ]; AutoButtonColor = false; Name = "\0"; BackgroundTransparency = 1; Position = dim2((i - 1) / total_tabs, 0, 0, 0); Size = dim2(1 / total_tabs, 0, 1, 0); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(25, 25, 29) }); local btn_label = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = i == 1 and rgb(255, 255, 255) or rgb(62, 62, 63); Text = tab_name; Parent = btn; Name = "\0"; Size = dim2(1, 0, 1, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Center; BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); local accent = library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = btn; Position = dim2(0, 4, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -8, 0, 3); BorderSizePixel = 0; BackgroundTransparency = i == 1 and 0 or 1; BackgroundColor3 = themes.preset.accent }); library:apply_theme(accent, "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = accent; CornerRadius = dim(0, 999) }); local container = library:create( "Frame" , { Parent = items[ "content" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BackgroundTransparency = 1; Position = dim2(0, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; Visible = i == 1; BackgroundColor3 = rgb(255, 255, 255) }); local elements = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); Parent = container; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 10, 0, 10); Size = dim2(1, -20, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = elements; Padding = dim(0, 10); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { PaddingBottom = dim(0, 15); Parent = elements }); page.btn = btn page.label = btn_label page.accent = accent page.scrolling = container page.items[ "elements" ] = elements local page_meta = setmetatable(page, library) cfg.pages[#cfg.pages + 1] = page_meta btn.MouseButton1Down:Connect(function() for _, p in cfg.pages do library:tween(p.label, {TextColor3 = rgb(62, 62, 63)}) library:tween(p.accent, {BackgroundTransparency = 1}) p.scrolling.Visible = false end library:tween(btn_label, {TextColor3 = rgb(255, 255, 255)}) library:tween(accent, {BackgroundTransparency = 0}) container.Visible = true cfg.current_tab = page_meta end) end end cfg.current_tab = cfg.pages[1] return table.unpack(cfg.pages) end function library:toggle(options) local rand = math.random(1, 2) local cfg = { enabled = options.enabled or nil, name = options.name or "Toggle", info = options.info or nil, flag = options.flag or library:next_flag(), type = options.type and string.lower(options.type) or rand == 1 and "toggle" or "checkbox"; -- "toggle", "checkbox" default = options.default or false, folding = options.folding or false, callback = options.callback or function() end, items = {}; seperator = options.seperator or options.Seperator or false; } flags[cfg.flag] = cfg.default local items = cfg.items; do items[ "toggle" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "toggle" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); if cfg.info then items[ "info" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(130, 130, 130); BorderColor3 = rgb(0, 0, 0); TextWrapped = true; Text = cfg.info; Parent = items[ "toggle" ]; Name = "\0"; Position = dim2(0, 5, 0, 17); Size = dim2(1, -10, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); end library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "toggle" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { FillDirection = Enum.FillDirection.Horizontal; HorizontalAlignment = Enum.HorizontalAlignment.Right; Parent = items[ "right_components" ]; Padding = dim(0, 9); SortOrder = Enum.SortOrder.LayoutOrder }); -- Toggle if cfg.type == "checkbox" then items[ "toggle_button" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; LayoutOrder = 2; AutoButtonColor = false; AnchorPoint = vec2(1, 0); Parent = items[ "right_components" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); Size = dim2(0, 16, 0, 16); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(67, 67, 68) }); library:apply_theme(items[ "toggle_button" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "toggle_button" ]; CornerRadius = dim(0, 4) }); items[ "outline" ] = library:create( "Frame" , { Parent = items[ "toggle_button" ]; Size = dim2(1, -2, 1, -2); Name = "\0"; BorderMode = Enum.BorderMode.Inset; BorderColor3 = rgb(0, 0, 0); Position = dim2(0, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:apply_theme(items[ "outline" ], "accent", "BackgroundColor3"); items[ "tick" ] = library:create( "ImageLabel" , { ImageTransparency = 1; BorderColor3 = rgb(0, 0, 0); Image = "rbxassetid://111862698467575"; BackgroundTransparency = 1; Position = dim2(0, -1, 0, 0); Parent = items[ "outline" ]; Size = dim2(1, 2, 1, 2); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255); ZIndex = 1; }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 4) }); library:create( "UIGradient" , { Enabled = false; Parent = items[ "outline" ]; Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))} }); else items[ "toggle_button" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; LayoutOrder = 2; AnchorPoint = vec2(1, 0.5); Parent = items[ "right_components" ]; Name = "\0"; Position = dim2(1, -9, 0.5, 0); Size = dim2(0, 36, 0, 18); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = themes.preset.accent }); library:apply_theme(items[ "toggle_button" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "toggle_button" ]; CornerRadius = dim(0, 999) }); items[ "inline" ] = library:create( "Frame" , { Parent = items[ "toggle_button" ]; Size = dim2(1, -2, 1, -2); Name = "\0"; BorderMode = Enum.BorderMode.Inset; BorderColor3 = rgb(0, 0, 0); Position = dim2(0, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = themes.preset.accent }); library:apply_theme(items[ "inline" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "inline" ]; CornerRadius = dim(0, 999) }); library:create( "UIGradient" , { Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))}; Parent = items[ "inline" ] }); items[ "circle" ] = library:create( "Frame" , { Parent = items[ "inline" ]; Name = "\0"; Position = dim2(1, -14, 0, 2); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 12, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UICorner" , { Parent = items[ "circle" ]; CornerRadius = dim(0, 999) }); end -- end; function cfg.set(bool) if cfg.type == "checkbox" then library:tween(items[ "tick" ], {Rotation = bool and 0 or 45, ImageTransparency = bool and 0 or 1}) library:tween(items[ "toggle_button" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(67, 67, 68)}) library:tween(items[ "outline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(22, 22, 24)}) else library:tween(items[ "toggle_button" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(58, 58, 62)}, Enum.EasingStyle.Quad) library:tween(items[ "inline" ], {BackgroundColor3 = bool and themes.preset.accent or rgb(50, 50, 50)}, Enum.EasingStyle.Quad) 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) end cfg.callback(bool) if cfg.folding then elements.Visible = bool end flags[cfg.flag] = bool end items[ "toggle" ].MouseButton1Click:Connect(function() cfg.enabled = not cfg.enabled cfg.set(cfg.enabled) end) items[ "toggle_button" ].MouseButton1Click:Connect(function() cfg.enabled = not cfg.enabled cfg.set(cfg.enabled) end) if cfg.seperator then -- ok bro my lua either sucks or this was a pain in the ass to make (simple if statement aswell 💔) library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = self.items[ "elements" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); end cfg.set(cfg.default) config_flags[cfg.flag] = cfg.set return setmetatable(cfg, library) end function library:slider(options) local cfg = { name = options.name or nil, suffix = options.suffix or "", flag = options.flag or library:next_flag(), callback = options.callback or function() end, info = options.info or nil; -- value settings min = options.min or options.minimum or 0, max = options.max or options.maximum or 100, intervals = options.interval or options.decimal or 1, default = options.default or 10, value = options.default or 10, seperator = options.seperator or options.Seperator or true; dragging = false, items = {} } flags[cfg.flag] = cfg.default local items = cfg.items; do items[ "slider_object" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "slider_object" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); if cfg.info then items[ "info" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(130, 130, 130); BorderColor3 = rgb(0, 0, 0); TextWrapped = true; Text = cfg.info; Parent = items[ "slider_object" ]; Name = "\0"; Position = dim2(0, 5, 0, 37); Size = dim2(1, -10, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); end library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "slider_object" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 4, 0, 23); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "right_components" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder; FillDirection = Enum.FillDirection.Horizontal }); items[ "slider" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; AnchorPoint = vec2(1, 0); Parent = items[ "right_components" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); Size = dim2(1, -4, 0, 4); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "slider" ]; CornerRadius = dim(0, 999) }); items[ "fill" ] = library:create( "Frame" , { Name = "\0"; Parent = items[ "slider" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(0.5, 0, 0, 4); BorderSizePixel = 0; BackgroundColor3 = themes.preset.accent }); library:apply_theme(items[ "fill" ], "accent", "BackgroundColor3"); library:create( "UICorner" , { Parent = items[ "fill" ]; CornerRadius = dim(0, 999) }); items[ "circle" ] = library:create( "Frame" , { AnchorPoint = vec2(0.5, 0.5); Parent = items[ "fill" ]; Name = "\0"; Position = dim2(1, 0, 0.5, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 12, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(244, 244, 244) }); library:create( "UICorner" , { Parent = items[ "circle" ]; CornerRadius = dim(0, 999) }); library:create( "UIPadding" , { Parent = items[ "right_components" ]; PaddingTop = dim(0, 4) }); items[ "value" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = "50%"; Parent = items[ "slider_object" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); Position = dim2(0, 6, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Right; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "value" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); end function cfg.set(value) cfg.value = clamp(library:round(value, cfg.intervals), cfg.min, cfg.max) 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) items[ "value" ].Text = tostring(cfg.value) .. cfg.suffix flags[cfg.flag] = cfg.value cfg.callback(flags[cfg.flag]) end items[ "slider" ].MouseButton1Down:Connect(function() cfg.dragging = true library:tween(items[ "value" ], {TextColor3 = rgb(255, 255, 255)}, Enum.EasingStyle.Quad, 0.2) end) library:connection(uis.InputChanged, function(input) if cfg.dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local size_x = (input.Position.X - items[ "slider" ].AbsolutePosition.X) / items[ "slider" ].AbsoluteSize.X local value = ((cfg.max - cfg.min) * size_x) + cfg.min cfg.set(value) end end) library:connection(uis.InputEnded, function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then cfg.dragging = false library:tween(items[ "value" ], {TextColor3 = rgb(72, 72, 73)}, Enum.EasingStyle.Quad, 0.2) end end) if cfg.seperator then library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = self.items[ "elements" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); end cfg.set(cfg.default) config_flags[cfg.flag] = cfg.set return setmetatable(cfg, library) end function library:dropdown(options) local cfg = { name = options.name or nil; info = options.info or nil; flag = options.flag or library:next_flag(); options = options.items or {""}; callback = options.callback or function() end; multi = options.multi or false; scrolling = options.scrolling or false; search = options.search or options.searchable or false; large = options.large or false; animate = options.animate ~= false; animation_time = options.animation_time or 0.2; width = options.width or 130; -- Ignore these open = false; option_instances = {}; multi_items = {}; ignore = options.ignore or false; items = {}; y_size; seperator = options.seperator or options.Seperator or true; } cfg.default = options.default or (cfg.multi and {cfg.options[1]}) or cfg.options[1] or "None" flags[cfg.flag] = cfg.default local items = cfg.items; do -- Element items[ "dropdown_object" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "dropdown_object" ]; Padding = dim(0, 6); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { Parent = items[ "dropdown_object" ]; PaddingRight = dim(0, 4); PaddingLeft = dim(0, 4) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "dropdown_object" ]; LayoutOrder = 1; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); if cfg.info then items[ "info" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(130, 130, 130); BorderColor3 = rgb(0, 0, 0); TextWrapped = true; Text = cfg.info; Parent = items[ "dropdown_object" ]; LayoutOrder = 2; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); end items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "dropdown_object" ]; LayoutOrder = cfg.info and 3 or 2; Name = "\0"; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, cfg.large and 28 or 16); BorderSizePixel = 0; BackgroundTransparency = 1; BackgroundColor3 = rgb(255, 255, 255) }); items[ "dropdown" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; Parent = items[ "right_components" ]; Name = "\0"; Position = dim2(0, 0, 0, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "dropdown" ]; CornerRadius = dim(0, 4) }); items[ "sub_text" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(86, 86, 87); BorderColor3 = rgb(0, 0, 0); Text = "awdawdawdawdawdawdawdaw"; Parent = items[ "dropdown" ]; Name = "\0"; Size = dim2(1, -12, 0, 0); BorderSizePixel = 0; BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; TextTruncate = Enum.TextTruncate.AtEnd; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "sub_text" ]; PaddingTop = dim(0, 1); PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "indicator" ] = library:create( "ImageLabel" , { ImageColor3 = rgb(86, 86, 87); BorderColor3 = rgb(0, 0, 0); Parent = items[ "dropdown" ]; AnchorPoint = vec2(1, 0.5); Image = "rbxassetid://101025591575185"; BackgroundTransparency = 1; Position = dim2(1, -5, 0.5, 0); Name = "\0"; Size = dim2(0, 12, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); -- -- Element Holder items[ "dropdown_holder" ] = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); Parent = library[ "items" ]; Name = "\0"; Visible = true; BackgroundTransparency = 1; Size = dim2(0, 0, 0, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(0, 0, 0); ZIndex = 10; }); items[ "outline" ] = library:create( "Frame" , { Parent = items[ "dropdown_holder" ]; Size = dim2(1, 0, 1, 0); ClipsDescendants = true; BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(33, 33, 35); ZIndex = 10; }); library:create( "UIPadding" , { PaddingBottom = dim(0, 6); PaddingTop = dim(0, 3); PaddingLeft = dim(0, 3); Parent = items[ "outline" ] }); library:create( "UIListLayout" , { Parent = items[ "outline" ]; Padding = dim(0, 5); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 4) }); -- end if cfg.search then items[ "search_input" ] = library:create( "TextBox" , { FontFace = fonts.small; Text = ""; PlaceholderText = "Search..."; PlaceholderColor3 = rgb(86, 86, 87); TextTransparency = 1; ClearTextOnFocus = false; LayoutOrder = -1; Parent = items[ "outline" ]; Name = "\0"; Size = dim2(1, -6, 0, 22); BorderSizePixel = 0; TextSize = 13; BackgroundColor3 = rgb(44, 44, 46); BackgroundTransparency = 1; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); ZIndex = 11; }); library:create( "UICorner" , {Parent = items[ "search_input" ]; CornerRadius = dim(0, 3)}); library:create( "UIPadding" , {Parent = items[ "search_input" ]; PaddingLeft = dim(0, 5)}); items[ "search_input" ]:GetPropertyChangedSignal("Text"):Connect(function() local q = items[ "search_input" ].Text:lower() local filtered = {} for _, opt in cfg.options do local option_text = tostring(opt) if q == "" or option_text:lower():find(q, 1, true) then insert(filtered, option_text) end end cfg.refresh_options(filtered, true) end) end function cfg.animate_dropdown(bool) if library.destroyed then return end if not cfg.animate then items[ "dropdown" ].BackgroundColor3 = bool and rgb(44, 44, 46) or rgb(33, 33, 35) items[ "indicator" ].Rotation = bool and 180 or 0 items[ "indicator" ].ImageColor3 = bool and rgb(245, 245, 245) or rgb(86, 86, 87) items[ "sub_text" ].TextColor3 = bool and rgb(200, 200, 200) or rgb(86, 86, 87) if items[ "search_input" ] then items[ "search_input" ].BackgroundTransparency = bool and 0 or 1 items[ "search_input" ].TextTransparency = bool and 0 or 1 end for _, option in cfg.option_instances do option.TextTransparency = bool and 0 or 1 end return end local duration = cfg.animation_time library:tween(items[ "dropdown" ], { BackgroundColor3 = bool and rgb(44, 44, 46) or rgb(33, 33, 35) }, Enum.EasingStyle.Quint, duration) library:tween(items[ "indicator" ], { Rotation = bool and 180 or 0, ImageColor3 = bool and rgb(245, 245, 245) or rgb(86, 86, 87) }, Enum.EasingStyle.Quint, duration) library:tween(items[ "sub_text" ], { TextColor3 = bool and rgb(200, 200, 200) or rgb(86, 86, 87) }, Enum.EasingStyle.Quint, duration) if items[ "search_input" ] then library:tween(items[ "search_input" ], { BackgroundTransparency = bool and 0 or 1, TextTransparency = bool and 0 or 1 }, Enum.EasingStyle.Quint, duration) end for _, option in cfg.option_instances do library:tween(option, { TextTransparency = bool and 0 or 1 }, Enum.EasingStyle.Quint, duration) end end function cfg.render_option(text) if library.destroyed or not items[ "outline" ] or items[ "outline" ].Parent == nil then return nil end local button = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = text; Parent = items[ "outline" ]; Name = "\0"; Size = dim2(1, -12, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; TextTransparency = cfg.open and 0 or 1; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255); ZIndex = 10; }); library:apply_theme(button, "accent", "TextColor3"); library:create( "UIPadding" , { Parent = button; PaddingTop = dim(0, 1); PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); return button end function cfg.recalculate_size() if library.destroyed then return 0 end local total = cfg.search and 27 or 0 for _, option in cfg.option_instances do local option_height = option.AbsoluteSize.Y if option_height <= 0 then option_height = max(option.TextBounds.Y + 2, 14) end total = total + option_height + 6 end cfg.y_size = total return total end function cfg.set_visible(bool) if library.destroyed or not items[ "dropdown_holder" ] or items[ "dropdown_holder" ].Parent == nil then return end if bool then cfg.recalculate_size() end local a = bool and cfg.y_size or 0 library:tween(items[ "dropdown_holder" ], {Size = dim_offset(items[ "dropdown" ].AbsoluteSize.X, a)}) cfg.animate_dropdown(bool) items[ "dropdown_holder" ].Position = dim2(0, items[ "dropdown" ].AbsolutePosition.X, 0, items[ "dropdown" ].AbsolutePosition.Y + items[ "dropdown" ].AbsoluteSize.Y + 4) if not (self.sanity and library.current_open == self) then library:close_element(cfg) end if bool then task.defer(function() if library.destroyed or not cfg.open or not items[ "dropdown_holder" ] or items[ "dropdown_holder" ].Parent == nil then return end local new_size = cfg.recalculate_size() library:tween(items[ "dropdown_holder" ], {Size = dim_offset(items[ "dropdown" ].AbsoluteSize.X, new_size)}) end) end end function cfg.set(value, suppress_callback) if library.destroyed then return end local selected = {} local isTable = type(value) == "table" local selected_lookup = {} if isTable then for _, current_value in value do local current_text = tostring(current_value) if not selected_lookup[current_text] then for _, option in cfg.options do local option_text = tostring(option) if option_text == current_text then insert(selected, option_text) selected_lookup[option_text] = true break end end end end cfg.multi_items = selected else local current_text = value ~= nil and tostring(value) or nil if current_text then for _, option in cfg.options do local option_text = tostring(option) if option_text == current_text then selected[1] = option_text selected_lookup[option_text] = true break end end end end for _, option in cfg.option_instances do if selected_lookup[option.Text] then option.TextColor3 = themes.preset.accent else option.TextColor3 = rgb(72, 72, 73) end end items[ "sub_text" ].Text = isTable and concat(selected, ", ") or selected[1] or "" flags[cfg.flag] = isTable and selected or selected[1] if not suppress_callback then cfg.callback(flags[cfg.flag]) end end function cfg.refresh_options(list, keep_source) if library.destroyed or not items[ "outline" ] or items[ "outline" ].Parent == nil then cfg.option_instances = {} cfg.y_size = 0 return end if not keep_source then cfg.options = list or {} end local render_list = list or {} if not keep_source then render_list = cfg.options if cfg.search and items[ "search_input" ] then local q = items[ "search_input" ].Text:lower() if q ~= "" then render_list = {} for _, option in cfg.options do local option_text = tostring(option) if option_text:lower():find(q, 1, true) then insert(render_list, option_text) end end end end end cfg.y_size = cfg.search and 27 or 0 for _, option in cfg.option_instances do option:Destroy() end cfg.option_instances = {} for _, option in render_list do local button = cfg.render_option(option) if button then insert(cfg.option_instances, button) button.MouseButton1Down:Connect(function() if cfg.multi then local selected_index = find(cfg.multi_items, button.Text) if selected_index then remove(cfg.multi_items, selected_index) else insert(cfg.multi_items, button.Text) end cfg.set(cfg.multi_items) else cfg.set_visible(false) cfg.open = false cfg.set(button.Text) end end) end end cfg.set(flags[cfg.flag], true) if cfg.open then cfg.recalculate_size() cfg.animate_dropdown(true) end task.defer(function() if library.destroyed or not items[ "dropdown_holder" ] or items[ "dropdown_holder" ].Parent == nil then return end cfg.recalculate_size() if cfg.open then library:tween(items[ "dropdown_holder" ], {Size = dim_offset(items[ "dropdown" ].AbsoluteSize.X, cfg.y_size)}) end end) end function cfg:SetValues(values) self.refresh_options(values) end function cfg:SetOptions(values) self.refresh_options(values) end function cfg:RefreshOptions(values) self.refresh_options(values) end items[ "dropdown" ].MouseButton1Click:Connect(function() cfg.open = not cfg.open cfg.set_visible(cfg.open) end) if cfg.seperator then library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = self.items[ "elements" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); end flags[cfg.flag] = {} config_flags[cfg.flag] = cfg.set cfg.refresh_options(cfg.options) cfg.set(cfg.default) return setmetatable(cfg, library) end function library:label(options) local cfg = { enabled = options.enabled or nil, name = options.name or "Toggle", seperator = options.seperator or options.Seperator or false; info = options.info or nil; items = {}; } local items = cfg.items; do items[ "label" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "label" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); if cfg.info then items[ "info" ] = library:create( "TextLabel" , { FontFace = fonts.small; TextColor3 = rgb(130, 130, 130); BorderColor3 = rgb(0, 0, 0); TextWrapped = true; Text = cfg.info; Parent = items[ "label" ]; Name = "\0"; Position = dim2(0, 5, 0, 17); Size = dim2(1, -10, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); end library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "label" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { FillDirection = Enum.FillDirection.Horizontal; HorizontalAlignment = Enum.HorizontalAlignment.Right; Parent = items[ "right_components" ]; Padding = dim(0, 9); SortOrder = Enum.SortOrder.LayoutOrder }); end if cfg.seperator then library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = self.items[ "elements" ]; Position = dim2(0, 0, 1, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); end return setmetatable(cfg, library) end function library:colorpicker(options) local cfg = { name = options.name or "Color", flag = options.flag or library:next_flag(), color = options.color or color(1, 1, 1), -- Default to white color if not provided alpha = options.alpha and 1 - options.alpha or 0, open = false, callback = options.callback or function() end, items = {}; seperator = options.seperator or options.Seperator or false; } local dragging_sat = false local dragging_hue = false local dragging_alpha = false local h, s, v = cfg.color:ToHSV() local a = cfg.alpha flags[cfg.flag] = {Color = cfg.color, Transparency = cfg.alpha} local label; if not self.items.right_components then label = self:label({name = cfg.name, seperator = cfg.seperator}) end local items = cfg.items; do -- Component items[ "colorpicker" ] = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; AnchorPoint = vec2(1, 0); Parent = label and label.items.right_components or self.items[ "right_components" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); Size = dim2(0, 16, 0, 16); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(54, 31, 184) }); library:create( "UICorner" , { Parent = items[ "colorpicker" ]; CornerRadius = dim(0, 4) }); items[ "colorpicker_inline" ] = library:create( "Frame" , { Parent = items[ "colorpicker" ]; Size = dim2(1, -2, 1, -2); Name = "\0"; BorderMode = Enum.BorderMode.Inset; BorderColor3 = rgb(0, 0, 0); Position = dim2(0, 1, 0, 1); BorderSizePixel = 0; BackgroundColor3 = rgb(54, 31, 184) }); library:create( "UICorner" , { Parent = items[ "colorpicker_inline" ]; CornerRadius = dim(0, 4) }); library:create( "UIGradient" , { Color = rgbseq{rgbkey(0, rgb(211, 211, 211)), rgbkey(1, rgb(211, 211, 211))}; Parent = items[ "colorpicker_inline" ] }); -- -- Colorpicker items[ "colorpicker_holder" ] = library:create( "Frame" , { Parent = library[ "other" ]; Name = "\0"; Position = dim2(0.20000000298023224, 20, 0.296999990940094, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 166, 0, 197); BorderSizePixel = 0; Visible = true; BackgroundColor3 = rgb(25, 25, 29) }); items[ "colorpicker_fade" ] = library:create( "Frame" , { Parent = items[ "colorpicker_holder" ]; Name = "\0"; BackgroundTransparency = 0; Position = dim2(0, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; ZIndex = 100; BackgroundColor3 = rgb(25, 25, 29) }); items[ "colorpicker_components" ] = library:create( "Frame" , { Parent = items[ "colorpicker_holder" ]; Name = "\0"; Position = dim2(0, 1, 0, 1); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -2, 1, -2); BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:create( "UICorner" , { Parent = items[ "colorpicker_components" ]; CornerRadius = dim(0, 6) }); items[ "saturation_holder" ] = library:create( "Frame" , { Parent = items[ "colorpicker_components" ]; Name = "\0"; Position = dim2(0, 7, 0, 7); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -14, 1, -80); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 39, 39) }); items[ "sat" ] = library:create( "TextButton" , { Parent = items[ "saturation_holder" ]; Name = "\0"; Size = dim2(1, 0, 1, 0); Text = ""; AutoButtonColor = false; BorderColor3 = rgb(0, 0, 0); ZIndex = 2; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UICorner" , { Parent = items[ "sat" ]; CornerRadius = dim(0, 4) }); library:create( "UIGradient" , { Rotation = 270; Transparency = numseq{numkey(0, 0), numkey(1, 1)}; Parent = items[ "sat" ]; Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(0, 0, 0))} }); items[ "val" ] = library:create( "Frame" , { Name = "\0"; Parent = items[ "saturation_holder" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIGradient" , { Parent = items[ "val" ]; Transparency = numseq{numkey(0, 0), numkey(1, 1)} }); library:create( "UICorner" , { Parent = items[ "val" ]; CornerRadius = dim(0, 4) }); library:create( "UICorner" , { Parent = items[ "saturation_holder" ]; CornerRadius = dim(0, 4) }); items[ "satvalpicker" ] = library:create( "TextButton" , { BorderColor3 = rgb(0, 0, 0); AutoButtonColor = false; Text = ""; AnchorPoint = vec2(0, 1); Parent = items[ "saturation_holder" ]; Name = "\0"; Position = dim2(0, 0, 4, 0); Size = dim2(0, 8, 0, 8); ZIndex = 5; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 0, 0) }); library:create( "UICorner" , { Parent = items[ "satvalpicker" ]; CornerRadius = dim(0, 9999) }); library:create( "UIStroke" , { Color = rgb(255, 255, 255); Parent = items[ "satvalpicker" ]; ApplyStrokeMode = Enum.ApplyStrokeMode.Border; }); items[ "hue_gradient" ] = library:create( "TextButton" , { Parent = items[ "colorpicker_components" ]; Name = "\0"; Position = dim2(0, 10, 1, -64); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -20, 0, 8); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255); AutoButtonColor = false; Text = ""; }); library:create( "UIGradient" , { 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))}; Parent = items[ "hue_gradient" ] }); library:create( "UICorner" , { Parent = items[ "hue_gradient" ]; CornerRadius = dim(0, 6) }); items[ "hue_picker" ] = library:create( "TextButton" , { BorderColor3 = rgb(0, 0, 0); AutoButtonColor = false; Text = ""; AnchorPoint = vec2(0, 0.5); Parent = items[ "hue_gradient" ]; Name = "\0"; Position = dim2(0, 0, 0.5, 0); Size = dim2(0, 8, 0, 8); ZIndex = 5; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 0, 0) }); library:create( "UICorner" , { Parent = items[ "hue_picker" ]; CornerRadius = dim(0, 9999) }); library:create( "UIStroke" , { Color = rgb(255, 255, 255); Parent = items[ "hue_picker" ]; ApplyStrokeMode = Enum.ApplyStrokeMode.Border; }); items[ "alpha_gradient" ] = library:create( "TextButton" , { Parent = items[ "colorpicker_components" ]; Name = "\0"; Position = dim2(0, 10, 1, -46); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -20, 0, 8); BorderSizePixel = 0; BackgroundColor3 = rgb(25, 25, 29); AutoButtonColor = false; Text = ""; }); library:create( "UICorner" , { Parent = items[ "alpha_gradient" ]; CornerRadius = dim(0, 6) }); items[ "alpha_picker" ] = library:create( "TextButton" , { BorderColor3 = rgb(0, 0, 0); AutoButtonColor = false; Text = ""; AnchorPoint = vec2(0, 0.5); Parent = items[ "alpha_gradient" ]; Name = "\0"; Position = dim2(1, 0, 0.5, 0); Size = dim2(0, 8, 0, 8); ZIndex = 5; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 0, 0) }); library:create( "UICorner" , { Parent = items[ "alpha_picker" ]; CornerRadius = dim(0, 9999) }); library:create( "UIStroke" , { Color = rgb(255, 255, 255); ApplyStrokeMode = Enum.ApplyStrokeMode.Border; Parent = items[ "alpha_picker" ] }); library:create( "UIGradient" , { Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(255, 255, 255))}; Parent = items[ "alpha_gradient" ] }); items[ "alpha_indicator" ] = library:create( "ImageLabel" , { ScaleType = Enum.ScaleType.Tile; BorderColor3 = rgb(0, 0, 0); Parent = items[ "alpha_gradient" ]; Image = "rbxassetid://18274452449"; BackgroundTransparency = 1; Name = "\0"; Size = dim2(1, 0, 1, 0); TileSize = dim2(0, 6, 0, 6); BorderSizePixel = 0; BackgroundColor3 = rgb(0, 0, 0) }); library:create( "UIGradient" , { Color = rgbseq{rgbkey(0, rgb(112, 112, 112)), rgbkey(1, rgb(255, 0, 0))}; Transparency = numseq{numkey(0, 0.8062499761581421), numkey(1, 0)}; Parent = items[ "alpha_indicator" ] }); library:create( "UICorner" , { Parent = items[ "alpha_indicator" ]; CornerRadius = dim(0, 6) }); library:create( "UIGradient" , { Rotation = 90; Parent = items[ "colorpicker_components" ]; Color = rgbseq{rgbkey(0, rgb(255, 255, 255)), rgbkey(1, rgb(66, 66, 66))} }); items[ "input" ] = library:create( "TextBox" , { FontFace = fonts.font; AnchorPoint = vec2(1, 1); Text = ""; Parent = items[ "colorpicker_components" ]; Name = "\0"; TextTruncate = Enum.TextTruncate.AtEnd; BorderSizePixel = 0; PlaceholderColor3 = rgb(255, 255, 255); CursorPosition = -1; ClearTextOnFocus = false; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255); TextColor3 = rgb(72, 72, 72); BorderColor3 = rgb(0, 0, 0); Position = dim2(1, -8, 1, -11); Size = dim2(1, -16, 0, 18); BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "input" ]; CornerRadius = dim(0, 3) }); items[ "UICorenr" ] = library:create( "UICorner" , { -- fire misstypo (im not fixing this RAWR) Parent = items[ "colorpicker_holder" ]; Name = "\0"; CornerRadius = dim(0, 4) }); -- end; function cfg.set_visible(bool) items[ "colorpicker_fade" ].BackgroundTransparency = 0 items[ "colorpicker_holder" ].Parent = bool and library[ "items" ] or library[ "other" ] items[ "colorpicker_holder" ].Position = dim_offset(items[ "colorpicker" ].AbsolutePosition.X, items[ "colorpicker" ].AbsolutePosition.Y + items[ "colorpicker" ].AbsoluteSize.Y + 45) library:tween(items[ "colorpicker_fade" ], {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4) library:tween(items[ "colorpicker_holder" ], {Position = items[ "colorpicker_holder" ].Position + dim_offset(0, 20)}) -- p100 check if not (self.sanity and library.current_open == self and self.open) then library:close_element(cfg) end end function cfg.set(color, alpha) if type(color) == "boolean" then return end if color then h, s, v = color:ToHSV() end if alpha then a = alpha end local Color = hsv(h, s, v) -- 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) -- 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. 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) 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) 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) items[ "alpha_indicator" ]:FindFirstChildOfClass("UIGradient").Color = rgbseq{rgbkey(0, rgb(112, 112, 112)), rgbkey(1, hsv(h, 1, 1))}; -- shit code items[ "colorpicker" ].BackgroundColor3 = Color items[ "colorpicker_inline" ].BackgroundColor3 = Color items[ "saturation_holder" ].BackgroundColor3 = hsv(h, 1, 1) items[ "hue_picker" ].BackgroundColor3 = hsv(h, 1, 1) items[ "alpha_picker" ].BackgroundColor3 = hsv(h, 1, 1 - a) items[ "satvalpicker" ].BackgroundColor3 = hsv(h, s, v) flags[cfg.flag] = { Color = Color; Transparency = a } local color = items[ "colorpicker" ].BackgroundColor3 items[ "input" ].Text = string.format("%s, %s, %s, ", library:round(color.R * 255), library:round(color.G * 255), library:round(color.B * 255)) items[ "input" ].Text = items[ "input" ].Text .. library:round(1 - a, 0.01) cfg.callback(Color, a) end function cfg.update_color() local mouse = uis:GetMouseLocation() local offset = vec2(mouse.X, mouse.Y - gui_offset) if dragging_sat then s = math.clamp((offset - items["sat"].AbsolutePosition).X / items["sat"].AbsoluteSize.X, 0, 1) v = 1 - math.clamp((offset - items["sat"].AbsolutePosition).Y / items["sat"].AbsoluteSize.Y, 0, 1) elseif dragging_hue then h = math.clamp((offset - items[ "hue_gradient" ].AbsolutePosition).X / items[ "hue_gradient" ].AbsoluteSize.X, 0, 1) elseif dragging_alpha then a = 1 - math.clamp((offset - items[ "alpha_gradient" ].AbsolutePosition).X / items[ "alpha_gradient" ].AbsoluteSize.X, 0, 1) end cfg.set() end items[ "colorpicker" ].MouseButton1Click:Connect(function() cfg.open = not cfg.open cfg.set_visible(cfg.open) end) uis.InputChanged:Connect(function(input) if (dragging_sat or dragging_hue or dragging_alpha) and input.UserInputType == Enum.UserInputType.MouseMovement then cfg.update_color() end end) library:connection(uis.InputEnded, function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging_sat = false dragging_hue = false dragging_alpha = false end end) items[ "alpha_gradient" ].MouseButton1Down:Connect(function() dragging_alpha = true end) items[ "hue_gradient" ].MouseButton1Down:Connect(function() dragging_hue = true end) items[ "sat" ].MouseButton1Down:Connect(function() dragging_sat = true end) items[ "input" ].FocusLost:Connect(function() local text = items[ "input" ].Text local r, g, b, a = library:convert(text) if r and g and b and a then cfg.set(rgb(r, g, b), 1 - a) end end) items[ "input" ].Focused:Connect(function() library:tween(items[ "input" ], {TextColor3 = rgb(245, 245, 245)}) end) items[ "input" ].FocusLost:Connect(function() library:tween(items[ "input" ], {TextColor3 = rgb(72, 72, 72)}) end) cfg.set(cfg.color, cfg.alpha) config_flags[cfg.flag] = cfg.set return setmetatable(cfg, library) end function library:textbox(options) local cfg = { name = options.name or "TextBox", placeholder = options.placeholder or options.placeholdertext or options.holder or options.holdertext or "type here...", default = options.default or "", flag = options.flag or library:next_flag(), callback = options.callback or function() end, visible = options.visible or true, items = {}; } flags[cfg.flag] = cfg.default local items = cfg.items; do items[ "textbox" ] = library:create( "TextButton" , { LayoutOrder = -1; FontFace = fonts.font; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "textbox" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "textbox" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 4, 0, 19); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 12); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "right_components" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder; FillDirection = Enum.FillDirection.Horizontal }); items[ "input" ] = library:create( "TextBox" , { FontFace = fonts.font; Text = ""; Parent = items[ "right_components" ]; Name = "\0"; TextTruncate = Enum.TextTruncate.AtEnd; BorderSizePixel = 0; PlaceholderText = cfg.placeholder; PlaceholderColor3 = rgb(86, 86, 87); CursorPosition = -1; ClearTextOnFocus = false; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255); TextColor3 = rgb(72, 72, 72); BorderColor3 = rgb(0, 0, 0); Position = dim2(1, 0, 0, 0); Size = dim2(1, -4, 0, 30); BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "input" ]; CornerRadius = dim(0, 3) }); library:create( "UIPadding" , { Parent = items[ "right_components" ]; PaddingTop = dim(0, 4); PaddingRight = dim(0, 4) }); end function cfg.set(text) flags[cfg.flag] = text items[ "input" ].Text = text cfg.callback(text) end items[ "input" ]:GetPropertyChangedSignal("Text"):Connect(function() cfg.set(items[ "input" ].Text) end) items[ "input" ].Focused:Connect(function() library:tween(items[ "input" ], {TextColor3 = rgb(245, 245, 245)}) end) items[ "input" ].FocusLost:Connect(function() library:tween(items[ "input" ], {TextColor3 = rgb(72, 72, 72)}) end) if cfg.default then cfg.set(cfg.default) end config_flags[cfg.flag] = cfg.set return setmetatable(cfg, library) end function library:keybind(options) local cfg = { flag = options.flag or library:next_flag(), callback = options.callback or function() end, name = options.name or nil, ignore_key = options.ignore or false, key = options.key or nil, mode = options.mode or "Toggle", active = options.default or false, open = false, binding = nil, hold_instances = {}, items = {}; } flags[cfg.flag] = { mode = cfg.mode, key = cfg.key, active = cfg.active } local items = cfg.items; do -- Component items[ "keybind_element" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "keybind_element" ]; Name = "\0"; Size = dim2(1, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 16; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "name" ]; PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); items[ "right_components" ] = library:create( "Frame" , { Parent = items[ "keybind_element" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 1, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { FillDirection = Enum.FillDirection.Horizontal; HorizontalAlignment = Enum.HorizontalAlignment.Right; Parent = items[ "right_components" ]; Padding = dim(0, 7); SortOrder = Enum.SortOrder.LayoutOrder }); items[ "keybind_holder" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; Parent = items[ "right_components" ]; AutoButtonColor = false; AnchorPoint = vec2(1, 0); Size = dim2(0, 0, 0, 16); Name = "\0"; Position = dim2(1, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.X; TextSize = 14; BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "keybind_holder" ]; CornerRadius = dim(0, 4) }); items[ "key" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(86, 86, 87); BorderColor3 = rgb(0, 0, 0); Text = "LSHIFT"; Parent = items[ "keybind_holder" ]; Name = "\0"; Size = dim2(1, -12, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { Parent = items[ "key" ]; PaddingTop = dim(0, 1); PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); -- -- Mode Holder items[ "dropdown" ] = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); Parent = library.items; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 0, 0, 0); Size = dim2(0, 0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.X; BackgroundColor3 = rgb(0, 0, 0) }); items[ "inline" ] = library:create( "Frame" , { Parent = items[ "dropdown" ]; Size = dim2(1, 0, 1, 0); Name = "\0"; ClipsDescendants = true; BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:create( "UIPadding" , { PaddingBottom = dim(0, 6); PaddingTop = dim(0, 3); PaddingLeft = dim(0, 3); Parent = items[ "inline" ] }); library:create( "UIListLayout" , { Parent = items[ "inline" ]; Padding = dim(0, 5); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UICorner" , { Parent = items[ "inline" ]; CornerRadius = dim(0, 4) }); local options = {"Hold", "Toggle", "Always"} cfg.y_size = 20 for _, option in options do local name = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = option; Parent = items[ "inline" ]; Name = "\0"; Size = dim2(0, 0, 0, 0); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); cfg.hold_instances[option] = name library:apply_theme(name, "accent", "TextColor3") cfg.y_size = cfg.y_size + name.AbsoluteSize.Y library:create( "UIPadding" , { Parent = name; PaddingTop = dim(0, 1); PaddingRight = dim(0, 5); PaddingLeft = dim(0, 5) }); name.MouseButton1Click:Connect(function() cfg.set(option) cfg.set_visible(false) cfg.open = false end) end -- end function cfg.modify_mode_color(path) -- ts so frikin tuff 💀 for _, v in cfg.hold_instances do v.TextColor3 = rgb(72, 72, 72) end cfg.hold_instances[path].TextColor3 = themes.preset.accent end function cfg.set_mode(mode) cfg.mode = mode if mode == "Always" then cfg.set(true) elseif mode == "Hold" then cfg.set(false) end flags[cfg.flag]["mode"] = mode cfg.modify_mode_color(mode) end function cfg.set(input) if type(input) == "boolean" then cfg.active = input if cfg.mode == "Always" then cfg.active = true end elseif tostring(input):find("Enum") then input = input.Name == "Escape" and "NONE" or input cfg.key = input or "NONE" elseif find({"Toggle", "Hold", "Always"}, input) then if input == "Always" then cfg.active = true end cfg.mode = input cfg.set_mode(cfg.mode) elseif type(input) == "table" then input.key = type(input.key) == "string" and input.key ~= "NONE" and library:convert_enum(input.key) or input.key input.key = input.key == Enum.KeyCode.Escape and "NONE" or input.key cfg.key = input.key or "NONE" cfg.mode = input.mode or "Toggle" if input.active then cfg.active = input.active end cfg.set_mode(cfg.mode) end cfg.callback(cfg.active) local text = tostring(cfg.key) ~= "Enums" and (keys[cfg.key] or tostring(cfg.key):gsub("Enum.", "")) or nil local __text = text and (tostring(text):gsub("KeyCode.", ""):gsub("UserInputType.", "")) items[ "key" ].Text = __text flags[cfg.flag] = { mode = cfg.mode, key = cfg.key, active = cfg.active } end function cfg.set_visible(bool) local size = bool and cfg.y_size or 0 library:tween(items[ "dropdown" ], {Size = dim_offset(items[ "keybind_holder" ].AbsoluteSize.X, size)}) items[ "dropdown" ].Position = dim_offset(items[ "keybind_holder" ].AbsolutePosition.X, items[ "keybind_holder" ].AbsolutePosition.Y + items[ "keybind_holder" ].AbsoluteSize.Y + 60) end items[ "keybind_holder" ].MouseButton1Down:Connect(function() task.wait() items[ "key" ].Text = "..." cfg.binding = library:connection(uis.InputBegan, function(keycode, game_event) cfg.set(keycode.KeyCode ~= Enum.KeyCode.Unknown and keycode.KeyCode or keycode.UserInputType) cfg.binding:Disconnect() cfg.binding = nil end) end) items[ "keybind_holder" ].MouseButton2Down:Connect(function() cfg.open = not cfg.open cfg.set_visible(cfg.open) end) library:connection(uis.InputBegan, function(input, game_event) if not game_event then local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType if selected_key == cfg.key then if cfg.mode == "Toggle" then cfg.active = not cfg.active cfg.set(cfg.active) elseif cfg.mode == "Hold" then cfg.set(true) end end end end) library:connection(uis.InputEnded, function(input, game_event) if game_event then return end local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType if selected_key == cfg.key then if cfg.mode == "Hold" then cfg.set(false) end end end) cfg.set({mode = cfg.mode, active = cfg.active, key = cfg.key}) config_flags[cfg.flag] = cfg.set return setmetatable(cfg, library) end function library:button(options) local cfg = { name = options.name or "Button", callback = options.callback or function() end, seperator = options.seperator or false, items = {}; } local items = cfg.items; do items[ "button_element" ] = library:create( "Frame" , { Parent = self.items[ "elements" ]; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(255, 255, 255) }); items[ "button" ] = library:create( "TextButton" , { FontFace = fonts.font; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; Parent = items[ "button_element" ]; Name = "\0"; Size = dim2(1, 0, 0, 30); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(33, 33, 35) }); library:create( "UICorner" , { Parent = items[ "button" ]; CornerRadius = dim(0, 5) }); library:create( "UIStroke" , { Color = rgb(44, 44, 46); Parent = items[ "button" ]; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); items[ "name" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(245, 245, 245); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "button" ]; Name = "\0"; BackgroundTransparency = 1; AnchorPoint = vec2(0.5, 0.5); Position = dim2(0.5, 0, 0.5, 0); Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; TextXAlignment = Enum.TextXAlignment.Center; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); if cfg.seperator then library:create( "Frame" , { Parent = items[ "button_element" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(1, 0, 0, 1); Position = dim2(0, 0, 0, 31); BorderSizePixel = 0; BackgroundColor3 = rgb(36, 36, 37) }); end end items[ "button" ].MouseButton1Click:Connect(function() cfg.callback() library:tween(items[ "button" ], {BackgroundColor3 = themes.preset.accent}, Enum.EasingStyle.Quad, 0.1) library:tween(items[ "button" ], {BackgroundColor3 = rgb(33, 33, 35)}, Enum.EasingStyle.Quad, 0.3) end) items[ "button" ].MouseEnter:Connect(function() library:tween(items[ "button" ], {BackgroundColor3 = rgb(44, 44, 46)}) end) items[ "button" ].MouseLeave:Connect(function() library:tween(items[ "button" ], {BackgroundColor3 = rgb(33, 33, 35)}) end) return setmetatable(cfg, library) end function library:settings(options) local cfg = { open = false; items = {}; sanity = true; -- made this for my own sanity. } local items = cfg.items; do items[ "outline" ] = library:create( "Frame" , { Name = "\0"; Visible = true; Parent = library[ "items" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 0, 0); ClipsDescendants = true; BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(25, 25, 29) }); items[ "inline" ] = library:create( "Frame" , { Parent = items[ "outline" ]; Name = "\0"; Position = dim2(0, 1, 0, 1); BorderColor3 = rgb(0, 0, 0); Size = dim2(1, -2, 0, 0); AutomaticSize = Enum.AutomaticSize.Y; BorderSizePixel = 0; BackgroundColor3 = rgb(22, 22, 24) }); library:create( "UICorner" , { Parent = items[ "inline" ]; CornerRadius = dim(0, 7) }); items[ "elements" ] = library:create( "Frame" , { BorderColor3 = rgb(0, 0, 0); Parent = items[ "inline" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 10, 0, 10); Size = dim2(1, -20, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "elements" ]; Padding = dim(0, 10); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { PaddingBottom = dim(0, 15); Parent = items[ "elements" ] }); library:create( "UICorner" , { Parent = items[ "outline" ]; CornerRadius = dim(0, 7) }); library:create( "UICorner" , { Parent = items[ "fade" ]; CornerRadius = dim(0, 7) }); items[ "tick" ] = library:create( "ImageButton" , { Image = "rbxassetid://128797200442698"; Name = "\0"; AutoButtonColor = false; Parent = self.items[ "right_components" ]; BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 16, 0, 16); BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255) }); end function cfg.set_visible(bool) library:tween(items[ "outline" ], {Size = dim_offset(bool and 240 or 0, 0)}) items[ "outline" ].Position = dim_offset(items[ "tick" ].AbsolutePosition.X, items[ "tick" ].AbsolutePosition.Y + 90) library:close_element(cfg) end items[ "tick" ].MouseButton1Click:Connect(function() cfg.open = not cfg.open cfg.set_visible(cfg.open) end) return setmetatable(cfg, library) end function library:list(properties) local cfg = { items = {}; options = properties.options or {"1", "2", "3"}; flag = properties.flag or library:next_flag(); callback = properties.callback or function() end; data_store = {}; current_element; } local items = cfg.items; do items[ "list" ] = library:create( "Frame" , { Parent = self.items[ "elements" ]; BackgroundTransparency = 1; Name = "\0"; Size = dim2(1, 0, 0, 0); BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIListLayout" , { Parent = items[ "list" ]; Padding = dim(0, 10); SortOrder = Enum.SortOrder.LayoutOrder }); library:create( "UIPadding" , { Parent = items[ "list" ]; PaddingRight = dim(0, 4); PaddingLeft = dim(0, 4) }); end function cfg.refresh_options(options_to_refresh) -- ignore goofy parameter for _,option in cfg.data_store do option:Destroy() end for _, option_data in options_to_refresh do -- haha u skids no next >_< local button = library:create( "TextButton" , { FontFace = fonts.small; TextColor3 = rgb(0, 0, 0); BorderColor3 = rgb(0, 0, 0); Text = ""; AutoButtonColor = false; AnchorPoint = vec2(1, 0); Parent = items[ "list" ]; Name = "\0"; Position = dim2(1, 0, 0, 0); Size = dim2(1, 0, 0, 30); BorderSizePixel = 0; TextSize = 14; BackgroundColor3 = rgb(33, 33, 35) }); cfg.data_store[#cfg.data_store + 1] = button; local name = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(72, 72, 73); BorderColor3 = rgb(0, 0, 0); Text = option_data; Parent = button; Name = "\0"; BackgroundTransparency = 1; Size = dim2(1, 0, 1, 0); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UICorner" , { Parent = button; CornerRadius = dim(0, 3) }); button.MouseButton1Click:Connect(function() local current = cfg.current_element if current and current ~= name then library:tween(current, {TextColor3 = rgb(72, 72, 72)}) end flags[cfg.flag] = option_data cfg.callback(option_data) library:tween(name, {TextColor3 = rgb(245, 245, 245)}) cfg.current_element = name end) name.MouseEnter:Connect(function() if cfg.current_element == name then return end library:tween(name, {TextColor3 = rgb(140, 140, 140)}) end) name.MouseLeave:Connect(function() if cfg.current_element == name then return end library:tween(name, {TextColor3 = rgb(72, 72, 72)}) end) end end cfg.refresh_options(cfg.options) return setmetatable(cfg, library) end function library:init_config(window) window:seperator({name = "Settings"}) local main = window:tab({name = "Configs", tabs = {"Main"}}) local column = main:column({}) local section = column:section({name = "Configs", size = 1, default = true, icon = "rbxassetid://139628202576511"}) config_holder = section:list({options = {"Report", "This", "Error", "To", "Finobe"}, callback = function(option) end, flag = "config_name_list"}); library:update_config_list() local column = main:column({}) local section = column:section({name = "Settings", side = "right", size = 1, default = true, icon = "rbxassetid://129380150574313"}) section:textbox({name = "Config name:", flag = "config_name_text"}) section:button({name = "Save", callback = function() writefile(library.directory .. "/configs/" .. flags["config_name_text"] or flags["config_name_list"] .. ".cfg", library:get_config()) library:update_config_list() notifications:create_notification({name = "Configs", info = "Saved config to:\n" .. flags["config_name_list"] or flags["config_name_text"]}) end}) section:button({name = "Load", callback = function() library:load_config(readfile(library.directory .. "/configs/" .. flags["config_name_list"] .. ".cfg")) library:update_config_list() notifications:create_notification({name = "Configs", info = "Loaded config:\n" .. flags["config_name_list"]}) end}) section:button({name = "Delete", callback = function() delfile(library.directory .. "/configs/" .. flags["config_name_list"] .. ".cfg") library:update_config_list() notifications:create_notification({name = "Configs", info = "Deleted config:\n" .. flags["config_name_list"]}) end}) section:colorpicker({name = "Menu Accent", callback = function(color, alpha) library:update_theme("accent", color) end, color = themes.preset.accent}) section:keybind({name = "Menu Bind", callback = function(bool) window.toggle_menu(bool) end, default = true}) end -- function library:keysystem(options) local cfg = { title = options.title or "millenium", subtitle = options.subtitle or "key system", 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, placeholder = options.placeholder or "enter your key...", button_name = options.button_name or "Verify Key", get_key_name = options.get_key_name or "Get Key", get_key = options.get_key or "", keys = options.keys or {}, validator = options.validator or nil, onSuccess = options.onSuccess or function() end, onFail = options.onFail or function() end, } local accent_color = themes.preset.accent local accent_hover = color( clamp(accent_color.R + 0.08, 0, 1), clamp(accent_color.G + 0.08, 0, 1), clamp(accent_color.B + 0.08, 0, 1) ) local image_id = cfg.image and tostring(cfg.image) or "" if image_id ~= "" and image_id:match("^%d+$") then image_id = "rbxassetid://" .. image_id end local has_image = image_id ~= "" local header_height = has_image and 112 or 58 local dialog_height = has_image and 314 or 260 local dialog_offset_y = has_image and -157 or -130 -- Root GUI local key_gui = library:create("ScreenGui", { Parent = coregui; Name = "\0"; ZIndexBehavior = Enum.ZIndexBehavior.Global; IgnoreGuiInset = true; Enabled = true; }) key_gui:SetAttribute(rerun_key, true) library[ "key_gui" ] = key_gui -- Dark overlay local overlay = library:create("Frame", { Parent = key_gui; Size = dim2(1, 0, 1, 0); BackgroundColor3 = rgb(0, 0, 0); BackgroundTransparency = 0.45; BorderSizePixel = 0; Name = "\0"; }) -- Dialog box (centered, 390 x 215) local dialog = library:create("Frame", { Parent = overlay; Size = dim2(0, 390, 0, dialog_height); Position = dim2(0.5, -195, 0.5, dialog_offset_y); BackgroundColor3 = rgb(14, 14, 16); BorderSizePixel = 0; Name = "\0"; }) library:create("UICorner", { Parent = dialog; CornerRadius = dim(0, 10) }) library:create("UIStroke", { Parent = dialog; Color = rgb(23, 23, 29); ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) -- Header zone local header = library:create("Frame", { Parent = dialog; Size = dim2(1, 0, 0, header_height); BackgroundTransparency = 1; BorderSizePixel = 0; Name = "\0"; }) if has_image then local image_holder = library:create("Frame", { Parent = header; Name = "key_image_holder"; Size = dim2(0, 56, 0, 56); Position = dim2(0.5, -28, 0, 10); BackgroundColor3 = rgb(19, 19, 21); BorderSizePixel = 0; }) library:create("UICorner", { Parent = image_holder; CornerRadius = dim(0, 10) }) library:create("UIStroke", { Parent = image_holder; Color = rgb(23, 23, 29); ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) library:create("ImageLabel", { Parent = image_holder; Name = "key_image"; Size = dim2(1, -12, 1, -12); Position = dim2(0, 6, 0, 6); BackgroundTransparency = 1; BorderSizePixel = 0; BackgroundColor3 = rgb(255, 255, 255); Image = image_id; ScaleType = Enum.ScaleType.Fit; }) end -- Title label (accent) local title_label = library:create("TextLabel", { Parent = header; Text = cfg.title; FontFace = fonts.font; TextColor3 = themes.preset.accent; TextSize = 22; Size = has_image and dim2(1, -20, 0, 28) or dim2(1, 0, 0, 30); Position = has_image and dim2(0, 10, 0, 72) or dim2(0, 0, 0, 10); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Center; BorderSizePixel = 0; Name = "\0"; }); library:apply_theme(title_label, "accent", "TextColor3") -- Subtitle label library:create("TextLabel", { Parent = header; Text = cfg.subtitle; FontFace = fonts.small; TextColor3 = rgb(86, 86, 87); TextSize = 13; Size = has_image and dim2(1, -20, 0, 16) or dim2(1, 0, 0, 16); Position = has_image and dim2(0, 10, 0, 94) or dim2(0, 0, 0, 36); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Center; BorderSizePixel = 0; Name = "\0"; }) -- Separator under header library:create("Frame", { Parent = dialog; Position = dim2(0, 0, 0, header_height); Size = dim2(1, 0, 0, 1); BackgroundColor3 = rgb(21, 21, 23); BorderSizePixel = 0; Name = "\0"; }) -- Content area local content = library:create("Frame", { Parent = dialog; Position = dim2(0, 0, 0, header_height + 1); Size = dim2(1, 0, 1, -(header_height + 1)); BackgroundTransparency = 1; BorderSizePixel = 0; Name = "\0"; }) library:create("UIPadding", { Parent = content; PaddingLeft = dim(0, 16); PaddingRight = dim(0, 16); PaddingTop = dim(0, 16); PaddingBottom = dim(0, 12); }) library:create("UIListLayout", { Parent = content; SortOrder = Enum.SortOrder.LayoutOrder; Padding = dim(0, 10); }) -- Key TextBox local input_frame = library:create("Frame", { Parent = content; Size = dim2(1, 0, 0, 34); BackgroundColor3 = rgb(33, 33, 35); BorderSizePixel = 0; LayoutOrder = 1; Name = "\0"; }) library:create("UICorner", { Parent = input_frame; CornerRadius = dim(0, 5) }) local input_stroke = library:create("UIStroke", { Parent = input_frame; Color = rgb(44, 44, 46); ApplyStrokeMode = Enum.ApplyStrokeMode.Border; }) local key_input = library:create("TextBox", { Parent = input_frame; Size = dim2(1, -10, 1, 0); Position = dim2(0, 5, 0, 0); BackgroundTransparency = 1; FontFace = fonts.small; TextSize = 14; TextColor3 = rgb(245, 245, 245); PlaceholderText = cfg.placeholder; PlaceholderColor3 = rgb(86, 86, 87); ClearTextOnFocus = false; Text = ""; BorderSizePixel = 0; Name = "\0"; }) -- Verify button local verify_btn = library:create("TextButton", { Parent = content; Size = dim2(1, 0, 0, 32); BackgroundColor3 = themes.preset.accent; BorderSizePixel = 0; FontFace = fonts.small; TextSize = 14; TextColor3 = rgb(255, 255, 255); Text = cfg.button_name; AutoButtonColor = false; LayoutOrder = 2; Name = "\0"; }); library:apply_theme(verify_btn, "accent", "BackgroundColor3") library:create("UICorner", { Parent = verify_btn; CornerRadius = dim(0, 5) }) -- Get Key button (copies input text to clipboard) local getkey_btn = library:create("TextButton", { Parent = content; Size = dim2(1, 0, 0, 32); BackgroundColor3 = rgb(33, 33, 35); BorderSizePixel = 0; FontFace = fonts.small; TextSize = 14; TextColor3 = rgb(200, 200, 200); Text = cfg.get_key_name; AutoButtonColor = false; LayoutOrder = 3; Name = "\0"; }) library:create("UICorner", { Parent = getkey_btn; CornerRadius = dim(0, 5) }) library:create("UIStroke", { Parent = getkey_btn; Color = rgb(44, 44, 46); ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) -- Status label local status_label = library:create("TextLabel", { Parent = content; Text = ""; FontFace = fonts.small; TextSize = 13; TextColor3 = rgb(200, 80, 80); Size = dim2(1, 0, 0, 16); BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Center; BorderSizePixel = 0; LayoutOrder = 4; Name = "\0"; }) -- Get Key hover + click getkey_btn.MouseEnter:Connect(function() library:tween(getkey_btn, {BackgroundColor3 = rgb(44, 44, 46)}) end) getkey_btn.MouseLeave:Connect(function() library:tween(getkey_btn, {BackgroundColor3 = rgb(33, 33, 35)}) end) getkey_btn.MouseButton1Click:Connect(function() local txt = cfg.get_key if txt == "" then return end local ok = pcall(setclipboard, txt) if not ok then pcall(toclipboard, txt) end local prev = getkey_btn.Text getkey_btn.Text = "Copied!" library:tween(getkey_btn, {TextColor3 = rgb(80, 200, 120)}) task.wait(1.2) getkey_btn.Text = prev library:tween(getkey_btn, {TextColor3 = rgb(200, 200, 200)}) end) -- Hover tint verify_btn.MouseEnter:Connect(function() library:tween(verify_btn, {BackgroundColor3 = accent_hover}) end) verify_btn.MouseLeave:Connect(function() library:apply_theme(verify_btn, "accent", "BackgroundColor3") library:tween(verify_btn, {BackgroundColor3 = themes.preset.accent}) end) local function close_and_succeed() library:tween(dialog, {Position = dim2(0.5, -195, 0.5, -80), BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4) library:tween(overlay, {BackgroundTransparency = 1}, Enum.EasingStyle.Quad, 0.4) task.wait(0.45) key_gui:Destroy() library[ "key_gui" ] = nil cfg.onSuccess() end local function on_fail() status_label.Text = "Invalid key." library:tween(input_stroke, {Color = rgb(180, 60, 60)}, Enum.EasingStyle.Quad, 0.15) task.wait(0.15) library:tween(input_stroke, {Color = rgb(44, 44, 46)}, Enum.EasingStyle.Quad, 0.5) library:tween(status_label, {TextColor3 = rgb(200, 80, 80)}, Enum.EasingStyle.Quad, 0.1) cfg.onFail() end verify_btn.MouseButton1Click:Connect(function() local entered = key_input.Text local valid = false if cfg.validator then valid = cfg.validator(entered) else for _, k in cfg.keys do if k == entered then valid = true break end end end if valid then status_label.TextColor3 = rgb(80, 200, 120) status_label.Text = "Key accepted!" task.spawn(close_and_succeed) else task.spawn(on_fail) end end) -- Allow Enter key to submit key_input.FocusLost:Connect(function(enter_pressed) if enter_pressed then verify_btn.MouseButton1Click:Fire() end end) end -- Notification Library function notifications:refresh_notifs() local offset = 50 for i, v in notifications.notifs do local Position = vec2(20, offset) library:tween(v, {Position = dim_offset(Position.X, Position.Y)}, Enum.EasingStyle.Quad, 0.4) offset = offset + (v.AbsoluteSize.Y + 10) end return offset end function notifications:fade(path, is_fading) local fading = is_fading and 1 or 0 library:tween(path, {BackgroundTransparency = fading}, Enum.EasingStyle.Quad, 1) for _, instance in path:GetDescendants() do if not instance:IsA("GuiObject") then if instance:IsA("UIStroke") then library:tween(instance, {Transparency = fading}, Enum.EasingStyle.Quad, 1) end else if instance:IsA("TextLabel") then library:tween(instance, {TextTransparency = fading}) elseif instance:IsA("Frame") then library:tween(instance, {BackgroundTransparency = instance.Transparency and 0.6 and is_fading and 1 or 0.6}, Enum.EasingStyle.Quad, 1) end end end end function notifications:create_notification(options) local cfg = { name = options.name or "This is a title!"; info = options.info or "This is extra info!"; lifetime = options.lifetime or 3; items = {}; outline; } local items = cfg.items; do items[ "notification" ] = library:create( "Frame" , { Parent = library[ "items" ]; Size = dim2(0, 210, 0, 53); Name = "\0"; BorderColor3 = rgb(0, 0, 0); BorderSizePixel = 0; BackgroundTransparency = 1; AnchorPoint = vec2(1, 0); AutomaticSize = Enum.AutomaticSize.Y; BackgroundColor3 = rgb(14, 14, 16) }); library:create( "UIStroke" , { Color = rgb(23, 23, 29); Parent = items[ "notification" ]; Transparency = 1; ApplyStrokeMode = Enum.ApplyStrokeMode.Border }); items[ "title" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(255, 255, 255); BorderColor3 = rgb(0, 0, 0); Text = cfg.name; Parent = items[ "notification" ]; Name = "\0"; BackgroundTransparency = 1; Position = dim2(0, 7, 0, 6); BorderSizePixel = 0; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UICorner" , { Parent = items[ "notification" ]; CornerRadius = dim(0, 3) }); items[ "info" ] = library:create( "TextLabel" , { FontFace = fonts.font; TextColor3 = rgb(145, 145, 145); BorderColor3 = rgb(0, 0, 0); Text = cfg.info; Parent = items[ "notification" ]; Name = "\0"; Position = dim2(0, 9, 0, 22); BorderSizePixel = 0; BackgroundTransparency = 1; TextXAlignment = Enum.TextXAlignment.Left; TextWrapped = true; AutomaticSize = Enum.AutomaticSize.XY; TextSize = 14; BackgroundColor3 = rgb(255, 255, 255) }); library:create( "UIPadding" , { PaddingBottom = dim(0, 17); PaddingRight = dim(0, 8); Parent = items[ "info" ] }); items[ "bar" ] = library:create( "Frame" , { AnchorPoint = vec2(0, 1); Parent = items[ "notification" ]; Name = "\0"; Position = dim2(0, 8, 1, -6); BorderColor3 = rgb(0, 0, 0); Size = dim2(0, 0, 0, 5); BackgroundTransparency = 1; BorderSizePixel = 0; BackgroundColor3 = themes.preset.accent }); library:create( "UICorner" , { Parent = items[ "bar" ]; CornerRadius = dim(0, 999) }); library:create( "UIPadding" , { PaddingRight = dim(0, 8); Parent = items[ "notification" ] }); end local index = #notifications.notifs + 1 notifications.notifs[index] = items[ "notification" ] notifications:fade(items[ "notification" ], false) local offset = notifications:refresh_notifs() items[ "notification" ].Position = dim_offset(20, offset) library:tween(items[ "notification" ], {AnchorPoint = vec2(0, 0)}, Enum.EasingStyle.Quad, 1) library:tween(items[ "bar" ], {Size = dim2(1, -8, 0, 5)}, Enum.EasingStyle.Quad, cfg.lifetime) task.spawn(function() task.wait(cfg.lifetime) notifications.notifs[index] = nil notifications:fade(items[ "notification" ], true) library:tween(items[ "notification" ], {AnchorPoint = vec2(1, 0)}, Enum.EasingStyle.Quad, 1) task.wait(1) items[ "notification" ]:Destroy() end) end -- -- return library