-- Source code here! local Library = {Count = 0, Tab = nil} local Themes = { Light = { Main = Color3.fromRGB(190, 190, 190), TabsBackground = Color3.fromRGB(54, 57, 63), ScrollBar = Color3.fromRGB(50, 50, 50), QuitText = Color3.fromRGB(220, 220, 220), TabDefault = Color3.fromRGB(150, 150, 160), TabHovered = Color3.fromRGB(50, 150, 170), TabSelected = Color3.fromRGB(45, 190, 220), DividerBackground = Color3.fromRGB(210, 210, 210), DividerText = Color3.fromRGB(50, 50, 50), OptionBackground = Color3.fromRGB(255, 255, 255), OptionHover = Color3.fromRGB(240, 240, 240), OptionClick = Color3.fromRGB(225, 225, 225), OptionText = Color3.fromRGB(50, 50, 50), OptionDescription = Color3.fromRGB(100, 100, 100), OptionImage = Color3.fromRGB(50, 50, 50), ToggleTrue = Color3.fromRGB(125, 230, 155), ToggleFalse = Color3.fromRGB(205, 95, 95), ToggleIndicator = Color3.fromRGB(50, 50, 50), DropdownOptionsBackground = Color3.fromRGB(255, 255, 255), DropdownScrollbar = Color3.fromRGB(200, 200, 200), DropdownOption = Color3.fromRGB(255, 255, 255), DropdownText = Color3.fromRGB(50, 50, 50), DropdownOptionHover = Color3.fromRGB(240, 240, 240), DropdownOptionClick = Color3.fromRGB(225, 225, 225), ColourPickerBackground = Color3.fromRGB(255, 255, 255), BoxOutline = Color3.fromRGB(150, 150, 150), BoxHover = Color3.fromRGB(100, 100, 100), BoxClick = Color3.fromRGB(50, 50, 50), BoxPlaceholder = Color3.fromRGB(225, 225, 225) }, Red = { Main = Color3.fromRGB(130, 30, 30), TabsBackground = Color3.fromRGB(122, 22, 22), ScrollBar = Color3.fromRGB(250, 150, 150), QuitText = Color3.fromRGB(240, 225, 225), TabDefault = Color3.fromRGB(225, 125, 125), TabHovered = Color3.fromRGB(240, 190, 190), TabSelected = Color3.fromRGB(355, 255, 255), DividerBackground = Color3.fromRGB(140, 40, 40), DividerText = Color3.fromRGB(255, 255, 255), OptionBackground = Color3.fromRGB(150, 50, 50), OptionHover = Color3.fromRGB(165, 65, 65), OptionClick = Color3.fromRGB(180, 80, 80), OptionText = Color3.fromRGB(255, 255, 255), OptionDescription = Color3.fromRGB(245, 205, 205), OptionImage = Color3.fromRGB(255, 255, 255), ToggleTrue = Color3.fromRGB(225, 230, 155), ToggleFalse = Color3.fromRGB(195, 95, 95), ToggleIndicator = Color3.fromRGB(255, 255, 255), DropdownOptionsBackground = Color3.fromRGB(150, 50, 50), DropdownScrollbar = Color3.fromRGB(130, 30, 30), DropdownOption = Color3.fromRGB(150, 50, 50), DropdownText = Color3.fromRGB(255, 255, 255), DropdownOptionHover = Color3.fromRGB(165, 65, 65), DropdownOptionClick = Color3.fromRGB(180, 80, 80), ColourPickerBackground = Color3.fromRGB(150, 50, 50), BoxOutline = Color3.fromRGB(225, 125, 125), BoxHover = Color3.fromRGB(235, 175, 175), BoxClick = Color3.fromRGB(245, 225, 225), BoxPlaceholder = Color3.fromRGB(245, 225, 225) }, Discord = { Main = Color3.fromRGB(54, 57, 63), TabsBackground = Color3.fromRGB(47, 49, 54), ScrollBar = Color3.fromRGB(54, 57, 63), QuitText = Color3.fromRGB(225, 225, 225), TabDefault = Color3.fromRGB(125, 125, 125), TabHovered = Color3.fromRGB(190, 190, 190), TabSelected = Color3.fromRGB(255, 255, 255), DividerBackground = Color3.fromRGB(64, 67, 73), DividerText = Color3.fromRGB(255, 255, 255), OptionBackground = Color3.fromRGB(88, 101, 242), OptionHover = Color3.fromRGB(71, 82, 196), OptionClick = Color3.fromRGB(75, 86, 203), OptionText = Color3.fromRGB(255, 255, 255), OptionDescription = Color3.fromRGB(205, 205, 205), OptionImage = Color3.fromRGB(255, 255, 255), ToggleTrue = Color3.fromRGB(22, 168, 76), ToggleFalse = Color3.fromRGB(47, 49, 54), ToggleIndicator = Color3.fromRGB(255, 255, 255), DropdownOptionsBackground = Color3.fromRGB(47,49,54), DropdownScrollbar = Color3.fromRGB(54, 57, 63), DropdownOption = Color3.fromRGB(88, 101, 242), DropdownText = Color3.fromRGB(255, 255, 255), DropdownOptionHover = Color3.fromRGB(71, 82, 196), DropdownOptionClick = Color3.fromRGB(75, 86, 203), ColourPickerBackground = Color3.fromRGB(47, 49, 54), BoxOutline = Color3.fromRGB(225, 225, 225), BoxHover = Color3.fromRGB(175, 175, 175), BoxClick = Color3.fromRGB(225, 225, 225), BoxPlaceholder = Color3.fromRGB(225, 225, 225) }, Dark = { Main = Color3.fromRGB(30, 30, 30), TabsBackground = Color3.fromRGB(22, 22, 22), ScrollBar = Color3.fromRGB(150, 150, 150), QuitText = Color3.fromRGB(225, 225, 225), TabDefault = Color3.fromRGB(125, 125, 125), TabHovered = Color3.fromRGB(190, 190, 190), TabSelected = Color3.fromRGB(255, 255, 255), DividerBackground = Color3.fromRGB(40, 40, 40), DividerText = Color3.fromRGB(255, 255, 255), OptionBackground = Color3.fromRGB(50, 50, 50), OptionHover = Color3.fromRGB(65, 65, 65), OptionClick = Color3.fromRGB(80, 80, 80), OptionText = Color3.fromRGB(255, 255, 255), OptionDescription = Color3.fromRGB(205, 205, 205), OptionImage = Color3.fromRGB(255, 255, 255), ToggleTrue = Color3.fromRGB(125, 230, 155), ToggleFalse = Color3.fromRGB(205, 95, 95), ToggleIndicator = Color3.fromRGB(255, 255, 255), DropdownOptionsBackground = Color3.fromRGB(50, 50, 50), DropdownScrollbar = Color3.fromRGB(30, 30, 30), DropdownOption = Color3.fromRGB(50, 50, 50), DropdownText = Color3.fromRGB(255, 255, 255), DropdownOptionHover = Color3.fromRGB(65, 65, 65), DropdownOptionClick = Color3.fromRGB(80, 80, 80), ColourPickerBackground = Color3.fromRGB(50, 50, 50), BoxOutline = Color3.fromRGB(125, 125, 125), BoxHover = Color3.fromRGB(175, 175, 175), BoxClick = Color3.fromRGB(225, 225, 225), BoxPlaceholder = Color3.fromRGB(225, 225, 225) } } local Objects = { Shadow = { Type = "ImageLabel", Name = "Shadow", AnchorPoint = Vector2.new(0.5, 0.5), BackgroundTransparency = 1, Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(1, 12, 1, 12), ImageTransparency = 0.5, Image = "rbxassetid://1316045217", ImageColor3 = Color3.fromRGB(22, 22, 22), ScaleType = Enum.ScaleType.Slice, SliceCenter = Rect.new(10, 10, 118, 118), }, Round = { Type = "UICorner", Name = "Rounding", CornerRadius = UDim.new(0, 4) }, MainOptionFrame = { Type = "TextButton", Name = "Button", Size = UDim2.new(1, -10, 0, 30), Text = "", AutoButtonColor = false }, OptionLabel = { Type = "TextLabel", Name = "ButtonLabel", BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 30), Font = Enum.Font.SourceSansSemibold, TextSize = 16, TextXAlignment = Enum.TextXAlignment.Left }, OptionDescription = { Type = "TextLabel", Name = "ButtonDescription", BackgroundTransparency = 1, TextTransparency = 1, Size = UDim2.new(1, 0, 0, 30), Font = Enum.Font.SourceSansSemibold, TextSize = 16, TextXAlignment = Enum.TextXAlignment.Left } } Library.Object = function(_, Type, Properties) local Object = nil if Objects[Type] and type(Objects[Type]) == "table" then Object = Instance.new(Objects[Type].Type) Object.Parent = Properties table.foreach(Objects[Type], function(Property, Value) if Property ~= "Type" then local s, e = pcall(function() Object[Property] = Value end) if not s then print(e) end end end) else Object = Instance.new(Type) table.foreach(Properties, function(Property, Value) local s, e = pcall(function() Object[Property] = Value end) if not s then print(e) table.foreach(Properties, print) end end) end return Object end --services and useful stuff local Player = game:GetService("Players").LocalPlayer local RS = game:GetService("RunService") local TS = game:GetService("TweenService") local UIS = game:GetService("UserInputService") local Mouse = Player:GetMouse() local TI = function(Time) return TweenInfo.new(Time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out) end --linoria's dragger local AddDragger = function(Frame) local S, Event = pcall(function() return Frame.MouseEnter end) if S then Frame.Active = true; Event:connect(function() local Input = Frame.InputBegan:connect(function(Key) if Key.UserInputType == Enum.UserInputType.MouseButton1 then local ObjectPosition = Vector2.new(Mouse.X - Frame.AbsolutePosition.X, Mouse.Y - Frame.AbsolutePosition.Y) while RS.RenderStepped:wait() and UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do Frame:TweenPosition(UDim2.new(0, Mouse.X - ObjectPosition.X + (Frame.Size.X.Offset * Frame.AnchorPoint.X), 0, Mouse.Y - ObjectPosition.Y + (Frame.Size.Y.Offset * Frame.AnchorPoint.Y)), 'Out', 'Quad', 0.06, true) end end end) local Leave Leave = Frame.MouseLeave:connect(function() Input:disconnect() Leave:disconnect() end) end) end end Library.Create = function(_, LibraryOptions) local self = Library self.Dropdowns = {} self.ColourPickers = {} LibraryOptions = LibraryOptions or {} LibraryOptions.Theme = LibraryOptions.Theme or "Dark" LibraryOptions.Name = LibraryOptions.Name or "UI Library" LibraryOptions.Size = LibraryOptions.Size or UDim2.new(0, 555, 0, 400) LibraryOptions.Developer = LibraryOptions.Developer or false local Theme = Themes[LibraryOptions.Theme] or Themes["Dark"] local Gui = self:Object("ScreenGui", { Name = "UILibrary", Parent = (RS:IsStudio() and Player.PlayerGui) or game.CoreGui }) local MainFrame = self:Object("Frame", { Name = "MainFrame", Parent = Gui, AnchorPoint = Vector2.new(0.5, 0.5), BackgroundTransparency = 1, Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 0, 0, 0) }) AddDragger(MainFrame) self:Object("Shadow", MainFrame) local OptionsContainer = self:Object("Frame", { Name = "OptionsContainer", Parent = MainFrame, Position = UDim2.new(0, 100, 0, 0), Size = UDim2.new(1, -100, 1, 0), BackgroundColor3 = Theme.Main, BorderSizePixel = 0 }) local OptionsContainerClips = self:Object("Frame", { BackgroundTransparency = 1, Parent = OptionsContainer, Size = UDim2.new(1, 200, 1, 0), ClipsDescendants = true }) self:Object("Frame", { Parent = OptionsContainer, Size = UDim2.new(0, 4, 1, 0), BorderSizePixel = 0, BackgroundColor3 = Theme.Main }) self:Object("Round", OptionsContainer) local Tabs = self:Object("Frame", { Name = "Tabs", Parent = MainFrame, BackgroundColor3 = Theme.TabsBackground, Size = UDim2.new(1, 0, 1, 0), ZIndex = 2 }) self:Object("Round", Tabs) local TabsRoundFix = self:Object("Frame", { Parent = MainFrame, BorderSizePixel = 0, BackgroundColor3 = Theme.TabsBackground, Size = UDim2.new(0, 3, 1, 0), Position = UDim2.new(0, 97, 0, 0) }) local TabsLayout = self:Object("UIListLayout", { Name = "TabsLayout", Parent = Tabs, HorizontalAlignment = Enum.HorizontalAlignment.Center }) local TabsPadding = self:Object("UIPadding", { Name = "TabsPadding", Parent = Tabs, PaddingTop = UDim.new(0, 6) }) --tabs tween Tabs.ChildAdded:connect(function(Child) TS:Create(Child:WaitForChild("NameLabel"), TI(0.2), {TextTransparency = 0}):Play() end) --open animation TS:Create(MainFrame, TI(0.3), {Size = LibraryOptions.Size}):Play() wait(0.3) TS:Create(Tabs, TI(0.3), {Size = UDim2.new(0, 100, 1, 0)}):Play() local UIToggleState = true UIS.InputEnded:connect(function(Input) if Input.KeyCode == Enum.KeyCode.RightControl then UIToggleState = not UIToggleState --[[if UIToggleState then TS:Create(Tabs, TI(0.2), {Size = UDim2.new(1, 0, 1, 0)}):Play() for i, v in next, Tabs:GetChildren() do spawn(function() if v.ClassName == "TextButton" then TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 1}):Play() end end) end for i, v in next, OptionsContainerClips:GetChildren() do if v.ClassName == "ScrollingFrame" then v.CanvasSize = UDim2.new(0, 0, 0, 0) end end wait(0.5) MainFrame.ClipsDescendants = true TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 0, 0, 0)}):Play() else TS:Create(MainFrame, TI(0.2), {Size = LibraryOptions.Size}):Play() MainFrame.ClipsDescendants = false wait(0.5) TS:Create(Tabs, TI(0.2), {Size = UDim2.new(0, 100, 1, 0)}):Play() for i, v in next, OptionsContainerClips:GetChildren() do if v.ClassName == "ScrollingFrame" then v.CanvasSize = UDim2.new(1, 0, 1, 0) end end for i, v in next, Tabs:GetChildren() do spawn(function() if v.ClassName == "TextButton" then TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 0}):Play() end end) end end]] local Old = MainFrame.Position if UIToggleState then MainFrame.Position = UDim2.new(0.5, 0 , 0.5, 0) else Old = MainFrame.Position MainFrame.Position = UDim2.new(0.5, 0, 10000, 0) end end end) local TabsLibrary = {} TabsLibrary.Quit = function(_, QuitOptions) QuitOptions = QuitOptions or {} QuitOptions.Message = QuitOptions.Message or "Goodbye..." QuitOptions.Length = QuitOptions.Length or 1 TS:Create(Tabs, TI(0.2), {Size = UDim2.new(1, 0, 1, 0)}):Play() for i, v in next, Tabs:GetChildren() do spawn(function() if v.ClassName == "TextButton" then TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 1}):Play() wait(0.15) v:Destroy() end end) end for i, v in next, OptionsContainerClips:GetChildren() do if v.ClassName == "ScrollingFrame" then v.CanvasSize = UDim2.new(0, 0, 0, 0) end end wait(0.5) MainFrame.ClipsDescendants = true TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 200, 0, 75)}):Play() wait(0.3) local QuitMessage = self:Object("TextLabel", { Parent = MainFrame, AnchorPoint = Vector2.new(0.5, 1), BackgroundTransparency = 1, TextTransparency = 1, Font = Enum.Font.SourceSansSemibold, TextSize = 20, Text = QuitOptions.Message, TextColor3 = Theme.QuitText, Position = UDim2.new(0.5, 0, 0.5, 0), ZIndex = 5 }) TS:Create(QuitMessage, TI(0.2), {TextTransparency = 0}):Play() wait(QuitOptions.Length) TS:Create(QuitMessage, TI(0.15), {TextTransparency = 1}):Play() TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 0, 0, 0)}):Play() wait(0.2) Gui:Destroy() end TabsLibrary.Tab = function(_, TabOptions) local Initial = (self.Count == 0 and true) or false TabOptions = TabOptions or {} TabOptions.Name = TabOptions.Name or "Tab" local Tab = self:Object("TextButton", { Name = "Tab", Parent = Tabs, BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 28), Text = "", ZIndex = 3 }) self.Selected = (Initial and Tab) or self.Selected local Label = self:Object("TextLabel", { Name = "NameLabel", Parent = Tab, Text = TabOptions.Name, BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 1, Position = UDim2.new(0, 6, 0, 0), Size = UDim2.new(1, 0, 1, 0), Font = Enum.Font.SourceSansSemibold, TextColor3 = (Initial and Theme.TabSelected) or Theme.TabDefault, TextSize = 18, TextTransparency = 1, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 4 }) local TextPadding = self:Object("UIPadding", { Name = "TabPadding", Parent = Label, PaddingLeft = UDim.new(0, 6) }) local FunctionsContainer = self:Object("ScrollingFrame", { Name = "Tab", Parent = OptionsContainerClips, Size = UDim2.new(1, -200, 1, 0), Visible = Initial, BorderSizePixel = 0, BackgroundTransparency = 1, CanvasSize = UDim2.new(0, 0, 0, 0), ScrollBarThickness = 2, ScrollingDirection = Enum.ScrollingDirection.Y, ScrollBarImageColor3 = Theme.ScrollBar, ClipsDescendants = false }) local FunctionsLayout = self:Object("UIListLayout", { Parent = FunctionsContainer, HorizontalAlignment = Enum.HorizontalAlignment.Center, Padding = UDim.new(0, 6) }) local FunctionsContainerPadding = self:Object("UIPadding", { Parent = FunctionsContainer, PaddingTop = UDim.new(0, 10) }) self.Count += 1 Tab.MouseEnter:connect(function() if Tab ~= self.Selected then TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabHovered}):Play() end end) Tab.MouseLeave:connect(function() if Tab ~= self.Selected then TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabDefault}):Play() end end) Tab.MouseButton1Click:connect(function() for i, v in next, OptionsContainerClips:GetChildren() do if v.Name == "Tab" then v.Visible = false end end for i, v in next, Tabs:GetChildren() do if v.Name == "Tab" and v ~= Tab then TS:Create(v.NameLabel, TI(0.1), {TextColor3 = Theme.TabDefault}):Play() end end TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabSelected}):Play() self.Selected = Tab FunctionsContainer.Visible = true end) local TabRefresh = function() FunctionsContainer.CanvasSize = UDim2.new(0, 0, 0, FunctionsLayout.AbsoluteContentSize.Y + 20) end local DividerLibrary = {} DividerLibrary.Divider = function(_, DividerOptions) DividerOptions = DividerOptions or {} DividerOptions.Name = DividerOptions.Name or "" local Divider = self:Object("Frame", { Name = "Divider", Parent = FunctionsContainer, BackgroundColor3 = Theme.DividerBackground, Size = UDim2.new(1, -20, 0, 0) }) self:Object("Round", Divider) local DividerLayout = self:Object("UIListLayout", { Parent = Divider, HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder, Padding = UDim.new(0, 6) }) if DividerOptions.Name ~= "" then local DividerNameLabel = self:Object("TextLabel", { Parent = Divider, BackgroundTransparency = 1, Font = Enum.Font.SourceSansSemibold, TextColor3 = Theme.DividerText, Size = UDim2.new(1, -10, 0, 12), TextSize = 18, TextXAlignment = Enum.TextXAlignment.Left, Text = DividerOptions.Name }) end local DividerPadding = self:Object("UIPadding", { Parent = Divider, PaddingTop = UDim.new(0, 5) }) local DividerRefresh = function() Divider.Size = UDim2.new(1, -20, 0, DividerLayout.AbsoluteContentSize.Y + 10) TabRefresh() end local AddDescriptionTweens = function(Button, Description) local ExpandSize = TS:Create(Button, TI(0.15), {Size = UDim2.new(1, -10, 0, 46)}) local CondenseSize = TS:Create(Button, TI(0.15), {Size = UDim2.new(1, -10, 0, 30)}) local ShowDescription = TS:Create(Description, TI(0.15), {Position = UDim2.new(0, 0, 0, 18), TextTransparency = 0}) local HideDescription = TS:Create(Description, TI(0.15), {Position = UDim2.new(0, 0, 0, 0), TextTransparency = 1}) Button.MouseEnter:connect(function() ShowDescription:Play() ExpandSize:Play() while ShowDescription.PlaybackState ~= Enum.PlaybackState.Completed and ExpandSize.PlaybackState ~= Enum.PlaybackState.Completed and RS.RenderStepped:wait() do DividerRefresh() end end) Button.MouseLeave:connect(function() HideDescription:Play() CondenseSize:Play() while RS.RenderStepped:wait() and HideDescription.PlaybackState ~= Enum.PlaybackState.Completed and CondenseSize.PlaybackState ~= Enum.PlaybackState.Completed do DividerRefresh() end end) end local AddOptionHoverTweens = function(Button) local ButtonHover = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionHover}) local ButtonClick = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionClick}) local ButtonDefault = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionBackground}) local Hovered = false Button.MouseEnter:connect(function() Hovered = true ButtonHover:Play() end) Button.MouseLeave:connect(function() Hovered = false ButtonDefault:Play() end) Button.MouseButton1Down:connect(function() ButtonClick:Play() UIS.InputEnded:connect(function(inputType) if inputType.UserInputType == Enum.UserInputType.MouseButton1 then if Hovered then ButtonHover:Play() else ButtonDefault:Play() end end end) end) end local OptionLibrary = {} OptionLibrary.Button = function(_, ButtonOptions) ButtonOptions = ButtonOptions or {} ButtonOptions.Name = ButtonOptions.Name or "Button" ButtonOptions.Callback = ButtonOptions.Callback or function() end local Button = self:Object("MainOptionFrame", Divider) Button.BackgroundColor3 = Theme.OptionBackground self:Object("Round", Button) local ButtonLabel = self:Object("OptionLabel", Button) ButtonLabel.Text = ButtonOptions.Name ButtonLabel.TextColor3 = Theme.OptionText local ButtonPadding = self:Object("UIPadding", { Parent = ButtonLabel, PaddingLeft = UDim.new(0, 6) }) local Click = self:Object("ImageLabel", { Name = "Click", Parent = Button, AnchorPoint = Vector2.new(1, 0.5), BackgroundTransparency = 1, Position = UDim2.new(1, -1, 0, 14), Size = UDim2.new(0, 28, 0, 28), Image = "http://www.roblox.com/asset/?id=5837528348", ImageColor3 = Theme.OptionImage }) if ButtonOptions.Description then local Description = self:Object("OptionDescription", Button) Description.Text = ButtonOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(Button, Description) end AddOptionHoverTweens(Button) Button.MouseButton1Click:connect(function() pcall(ButtonOptions.Callback) end) DividerRefresh() local ButtonLibrary = {} ButtonLibrary.HideElement = function() Button.Visible = false DividerRefresh() end ButtonLibrary.ShowElement = function() Button.Visible = true DividerRefresh() end ButtonLibrary.Fire = function() pcall(ButtonOptions.Callback) end return ButtonLibrary end OptionLibrary.Toggle = function(_, ToggleOptions) ToggleOptions = ToggleOptions or {} ToggleOptions.Name = ToggleOptions.Name or "Toggle" ToggleOptions.Style = ToggleOptions.Style or 1 ToggleOptions.State = ToggleOptions.State or false ToggleOptions.Callback = ToggleOptions.Callback or function() end local Toggle = self:Object("MainOptionFrame", Divider) Toggle.BackgroundColor3 = Theme.OptionBackground Toggle.Name = "Toggle" self:Object("Round", Toggle) local ToggleLabel = self:Object("OptionLabel", Toggle) ToggleLabel.Text = ToggleOptions.Name ToggleLabel.TextColor3 = Theme.OptionText self:Object("UIPadding", { Parent = ToggleLabel, PaddingLeft = UDim.new(0, 6) }) if ToggleOptions.Description then local Description = self:Object("OptionDescription", Toggle) Description.Text = ToggleOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(Toggle, Description) end local ToggleFunction = nil if ToggleOptions.Style == 1 then local Colour = self:Object("Frame", { Name = "Colour", Parent = Toggle, AnchorPoint = Vector2.new(1, 0), BackgroundColor3 = (ToggleOptions.State and Theme.ToggleTrue) or Theme.ToggleFalse, Position = UDim2.new(1, -4, 0, 4), Size = UDim2.new(0, 40, 0, 22) }) self:Object("Round", Colour) local Sliding = self:Object("Frame", { Parent = Colour, AnchorPoint = Vector2.new(0, 0.5), BackgroundColor3 = Theme.ToggleIndicator, Position = (ToggleOptions.State and UDim2.new(1, -22, 0.5, 0)) or UDim2.new(0, 2, 0.5, 0), Size = UDim2.new(0.5, -2, 1, -4), ZIndex = 2 }) self:Object("Round", Sliding) local SlidingToFalse = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(0, 2, 0.5, 0)}) local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse}) local SlidingToTrue = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(1, -20, 0.5, 0)}) local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue}) ToggleFunction = function(State) spawn(function() local S, E = pcall(ToggleOptions.Callback, State) if not S then print(E) end end) if State then SlidingToTrue:Play() ColourToTrue:Play() else SlidingToFalse:Play() ColourToFalse:Play() end end Toggle.MouseButton1Click:connect(function() ToggleOptions.State = not ToggleOptions.State ToggleFunction(ToggleOptions.State) end) elseif ToggleOptions.Style == 2 then local Colour = self:Object("Frame", { Name = "Colour", Parent = Toggle, AnchorPoint = Vector2.new(1, 0), BackgroundColor3 = ToggleOptions.State and Theme.ToggleTrue or Theme.ToggleFalse, Position = UDim2.new(1, -4, 0, 4), Size = UDim2.new(0, Toggle.AbsoluteSize.Y - 8, 0, 22) }) self:Object("Round", Colour) local Frame1 = self:Object("Frame", { Parent = Colour, Size = UDim2.new(0, 4, 0, 18), BorderSizePixel = 0, Rotation = 45, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Theme.ToggleIndicator }) local Frame1Round = self:Object("Round", Frame1) Frame1Round.CornerRadius = UDim.new(0, 2) local Frame2 = self:Object("Frame", { Parent = Colour, Size = UDim2.new(0, 4, 0, 18), BorderSizePixel = 0, Rotation = 135, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Theme.ToggleIndicator }) local Frame2Round = self:Object("Round", Frame2) Frame2Round.CornerRadius = UDim.new(0, 2) local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse}) local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue}) local Frame1ToFalse = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)}) local Frame2ToFalse = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)}) local Frame1ToTrue = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.65, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 16)}) local Frame2ToTrue = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.35, 0, 0.5, 2), Size = UDim2.new(0, 5, 0, 11)}) ToggleFunction = function(State) spawn(function() pcall(ToggleOptions.Callback, State) end) if State then ColourToTrue:Play() Frame1ToTrue:Play() Frame2ToTrue:Play() else ColourToFalse:Play() Frame1ToFalse:Play() Frame2ToFalse:Play() end end Toggle.MouseButton1Click:connect(function() ToggleOptions.State = not ToggleOptions.State ToggleFunction(ToggleOptions.State) end) end AddOptionHoverTweens(Toggle) DividerRefresh() local ToggleLibrary = {} ToggleLibrary.Toggle = function() ToggleOptions.State = not ToggleOptions.State ToggleFunction(ToggleOptions.State) end ToggleLibrary.SetState = function(_, State) ToggleFunction(State) ToggleOptions.State = State end ToggleLibrary.GetState = function() return ToggleOptions.State end ToggleLibrary.HideElement = function() Toggle.Visible = false DividerRefresh() end ToggleLibrary.ShowElement = function() Toggle.Visible = true DividerRefresh() end return ToggleLibrary end OptionLibrary.ToggleDropdown = function(_, ToggleDropdownOptions) ToggleDropdownOptions = ToggleDropdownOptions or {} ToggleDropdownOptions.Name = ToggleDropdownOptions.Name or "Toggle" ToggleDropdownOptions.Style = ToggleDropdownOptions.Style or 1 ToggleDropdownOptions.State = ToggleDropdownOptions.State or false ToggleDropdownOptions.Callback = ToggleDropdownOptions.Callback or function() end local Toggle = self:Object("MainOptionFrame", Divider) Toggle.BackgroundColor3 = Theme.OptionBackground Toggle.Name = "Toggle" self:Object("Round", Toggle) local ToggleLabel = self:Object("OptionLabel", Toggle) ToggleLabel.Text = ToggleDropdownOptions.Name ToggleLabel.TextColor3 = Theme.OptionText self:Object("UIPadding", { Parent = ToggleLabel, PaddingLeft = UDim.new(0, 6) }) if ToggleDropdownOptions.Description then local Description = self:Object("OptionDescription", Toggle) Description.Text = ToggleDropdownOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(Toggle, Description) end local ToggleFunction = nil if ToggleDropdownOptions.Style == 1 then local Colour = self:Object("Frame", { Name = "Colour", Parent = Toggle, AnchorPoint = Vector2.new(1, 0), BackgroundColor3 = (ToggleDropdownOptions.State and Theme.ToggleTrue) or Theme.ToggleFalse, Position = UDim2.new(1, -4, 0, 4), Size = UDim2.new(0, 40, 0, 22) }) self:Object("Round", Colour) local Sliding = self:Object("Frame", { Parent = Colour, AnchorPoint = Vector2.new(0, 0.5), BackgroundColor3 = Theme.ToggleIndicator, Position = (ToggleDropdownOptions.State and UDim2.new(1, -22, 0.5, 0)) or UDim2.new(0, 2, 0.5, 0), Size = UDim2.new(0.5, -2, 1, -4), ZIndex = 2 }) self:Object("Round", Sliding) local SlidingToFalse = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(0, 2, 0.5, 0)}) local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse}) local SlidingToTrue = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(1, -20, 0.5, 0)}) local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue}) ToggleFunction = function(State) spawn(function() pcall(ToggleDropdownOptions.Callback, State) end) if State then SlidingToTrue:Play() ColourToTrue:Play() else SlidingToFalse:Play() ColourToFalse:Play() end end Toggle.MouseButton1Click:connect(function() ToggleDropdownOptions.State = not ToggleDropdownOptions.State ToggleFunction(ToggleDropdownOptions.State) end) elseif ToggleDropdownOptions.Style == 2 then local Colour = self:Object("Frame", { Name = "Colour", Parent = Toggle, AnchorPoint = Vector2.new(1, 0), BackgroundColor3 = ToggleDropdownOptions.State and Theme.ToggleTrue or Theme.ToggleFalse, Position = UDim2.new(1, -4, 0, 4), Size = UDim2.new(0, Toggle.AbsoluteSize.Y - 8, 0, 22) }) self:Object("Round", Colour) local Frame1 = self:Object("Frame", { Parent = Colour, Size = UDim2.new(0, 4, 0, 18), BorderSizePixel = 0, Rotation = 45, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Theme.ToggleIndicator }) local Frame1Round = self:Object("Round", Frame1) Frame1Round.CornerRadius = UDim.new(0, 2) local Frame2 = self:Object("Frame", { Parent = Colour, Size = UDim2.new(0, 4, 0, 18), BorderSizePixel = 0, Rotation = 135, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Theme.ToggleIndicator }) local Frame2Round = self:Object("Round", Frame2) Frame2Round.CornerRadius = UDim.new(0, 2) local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse}) local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue}) local Frame1ToFalse = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)}) local Frame2ToFalse = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)}) local Frame1ToTrue = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.65, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 16)}) local Frame2ToTrue = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.35, 0, 0.5, 2), Size = UDim2.new(0, 5, 0, 11)}) ToggleFunction = function(State) spawn(function() pcall(ToggleDropdownOptions.Callback, State) end) if State then ColourToTrue:Play() Frame1ToTrue:Play() Frame2ToTrue:Play() else ColourToFalse:Play() Frame1ToFalse:Play() Frame2ToFalse:Play() end end Toggle.MouseButton1Click:connect(function() ToggleDropdownOptions.State = not ToggleDropdownOptions.State ToggleFunction(ToggleDropdownOptions.State) end) end AddOptionHoverTweens(Toggle) DividerRefresh() local ToggleLibrary = {} ToggleLibrary.Toggle = function() ToggleDropdownOptions.State = not ToggleDropdownOptions.State ToggleFunction(ToggleDropdownOptions.State) end ToggleLibrary.SetState = function(_, State) ToggleFunction(State) ToggleDropdownOptions.State = State end ToggleLibrary.GetState = function() return ToggleDropdownOptions.State end ToggleLibrary.HideElement = function() Toggle.Visible = false DividerRefresh() end ToggleLibrary.ShowElement = function() Toggle.Visible = true DividerRefresh() end return ToggleLibrary end OptionLibrary.Dropdown = function(_, DropdownOptions) DropdownOptions = DropdownOptions or {} DropdownOptions.Name = DropdownOptions.Name or "Dropdown" DropdownOptions.Options = DropdownOptions.Options or {} DropdownOptions.Callback = DropdownOptions.Callback or function() end local DropdownButtons = {} local Value = nil local State = false local Dropdown = self:Object("MainOptionFrame", Divider) Dropdown.BackgroundColor3 = Theme.OptionBackground Dropdown.Name = "Dropdown" self:Object("Round", Dropdown) local DropdownLabel = self:Object("OptionLabel", Dropdown) DropdownLabel.Text = DropdownOptions.Name DropdownLabel.TextColor3 = Theme.OptionText local DropdownPadding = self:Object("UIPadding", { Parent = DropdownLabel, PaddingLeft = UDim.new(0, 6) }) local Arrow = self:Object("ImageLabel", { Name = "Arrow", Parent = Dropdown, AnchorPoint = Vector2.new(1, 0.5), BackgroundTransparency = 1, Position = UDim2.new(1, -1, 0, 14), Size = UDim2.new(0, 28, 0, 28), Image = "http://www.roblox.com/asset/?id=5844057859", ImageColor3 = Theme.OptionImage, Rotation = -90 }) local OptionsFrameContainer = self:Object("Frame", { Parent = Dropdown, Name = "OptionsFrameContainer", Position = UDim2.new(1, 20, 0, 0), BackgroundColor3 = Theme.DropdownOptionsBackground, BorderSizePixel = 0, Size = UDim2.new(0, 100, 0, 0) }) self:Object("Round", OptionsFrameContainer) self:Object("UIPadding", { Parent = OptionsFrameContainer, PaddingTop = UDim.new(0, 5) }) local OptionsFrame = self:Object("ScrollingFrame", { Name = "OptionsFrame", Parent = OptionsFrameContainer, BorderSizePixel = 0, BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, -5), CanvasSize = UDim2.new(0, 0, 0, 0), ScrollingDirection = Enum.ScrollingDirection.Y, ScrollBarThickness = 0 }) local OptionsLayout = self:Object("UIListLayout", { Parent = OptionsFrame, HorizontalAlignment = Enum.HorizontalAlignment.Left }) local RefreshOptionsFrame = function() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, OptionsLayout.AbsoluteContentSize.Y) end local CondenseOptionsFrame = TS:Create(OptionsFrameContainer, TI(0.1), {Size = UDim2.new(0, 150, 0, 0)}) local AddDropdownButton = function(Name) local Button = self:Object("TextButton", { Parent = OptionsFrame, Size = UDim2.new(1, 0, 0, 20), BorderSizePixel = 0, Text = tostring(Name), BackgroundColor3 = Theme.DropdownOption, Font = Enum.Font.SourceSansSemibold, TextColor3 = Theme.DropdownText, TextSize = 16, AutoButtonColor = false, TextXAlignment = Enum.TextXAlignment.Left }) self:Object("UIPadding", { Parent = Button, PaddingLeft = UDim.new(0, 5) }) local OptionHover = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOptionHover}) local OptionClick = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOptionClick}) local OptionDefault = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOption}) local Hovered = false Button.MouseEnter:connect(function() Hovered = true OptionHover:Play() end) Button.MouseLeave:connect(function() Hovered = false OptionDefault:Play() end) Button.MouseButton1Down:connect(function() OptionClick:Play() UIS.InputEnded:connect(function(inputType) if inputType.UserInputType == Enum.UserInputType.MouseButton1 then if Hovered then OptionHover:Play() else OptionDefault:Play() end end end) end) Button.MouseButton1Click:connect(function() pcall(DropdownOptions.Callback, tostring(Name)) CondenseOptionsFrame:Play() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) State = false Value = tostring(Name) DropdownLabel.Text = DropdownOptions.Name .. [[ \ ]] .. tostring(Name) TS:Create(Arrow, TI(0.1), {Position = UDim2.new(1, -1, 0, 14)}):Play() end) table.insert(DropdownButtons, {Name = tostring(Name), Button = Button}) end table.foreach(DropdownOptions.Options, function(_, Name) AddDropdownButton(Name) end) if DropdownOptions.Description then local Description = self:Object("OptionDescription", Dropdown) Description.Text = DropdownOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(Dropdown, Description) end local function Reset() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) CondenseOptionsFrame:Play() TS:Create(Arrow, TI(0.1), {Position = UDim2.new(1, -1, 0, 14)}):Play() State = false end Dropdown.MouseButton1Click:connect(function() State = not State if State then table.foreach(self.Dropdowns, function(_, ResetFunction) if ResetFunction ~= Reset then ResetFunction() end end) table.foreach(self.ColourPickers, function(_, ResetFunction) if ResetFunction[2] ~= Reset then ResetFunction[2]() ResetFunction[1]:Play() ResetFunction[3].Visible = false end end) RefreshOptionsFrame() TS:Create(OptionsFrameContainer, TI(0.1), {Size = UDim2.new(0, 150, 0, ((OptionsLayout.AbsoluteContentSize.Y < 100) and (OptionsLayout.AbsoluteContentSize.Y + 10)) or 110)}):Play() TS:Create(Arrow, TI(0.1), {Position = UDim2.new(1, 2, 0, 14)}):Play() else OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) CondenseOptionsFrame:Play() TS:Create(Arrow, TI(0.1), {Position = UDim2.new(1, -1, 0, 14)}):Play() end end) table.insert(self.Dropdowns, Reset) AddOptionHoverTweens(Dropdown) DividerRefresh() local DropdownLibrary = {} DropdownLibrary.GetValue = function() return Value end DropdownLibrary.SetValue = function(_, LocalValue) Value = LocalValue DropdownLabel.Text = DropdownOptions.Name .. [[ \ ]] .. tostring(LocalValue) end DropdownLibrary.AddOption = function(_, Option) AddDropdownButton(Option) end DropdownLibrary.RemoveOption = function(_, Option) table.foreach(DropdownButtons, function(_, Button) if Button.Name == tostring(Option) then Button.Button:Destroy() Button = nil return end end) end DropdownLibrary.HideElement = function() Dropdown.Visible = false DividerRefresh() end DropdownLibrary.ShowElement = function() Dropdown.Visible = true DividerRefresh() end return DropdownLibrary end OptionLibrary.ColorPicker = function(_, ColourPickerOptions) ColourPickerOptions = ColourPickerOptions or {} ColourPickerOptions.Name = ColourPickerOptions.Name or "Colour Picker" ColourPickerOptions.Default = ColourPickerOptions.Default or Color3.fromRGB(0, 255, 255) ColourPickerOptions.Callback = ColourPickerOptions.Callback or function() end local Colour = ColourPickerOptions.Default local Hue, XPercent, YPercent = ColourPickerOptions.Default:ToHSV() local State = false local MainColourDown = false local HueDown = false local ColourPicker = self:Object("MainOptionFrame", Divider) ColourPicker.BackgroundColor3 = Theme.OptionBackground ColourPicker.Name = "ColourPicker" self:Object("Round", ColourPicker) local ColourPickerLabel = self:Object("OptionLabel", ColourPicker) ColourPickerLabel.Text = ColourPickerOptions.Name ColourPickerLabel.TextColor3 = Theme.OptionText local ColourPickerPadding = self:Object("UIPadding", { Parent = ColourPickerLabel, PaddingLeft = UDim.new(0, 6) }) if ColourPickerOptions.Description then local Description = self:Object("OptionDescription", ColourPicker) Description.Text = ColourPickerOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(ColourPicker, Description) end local ColourIndicator = self:Object("Frame", { Name = "Colour", Parent = ColourPicker, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -4, 0, 4), Size = UDim2.new(0, 40, 0, 22), BackgroundColor3 = ColourPickerOptions.Default }) self:Object("Round", ColourIndicator) local ColourPickerContainer = self:Object("Frame", { Name = "Container", Visible = false, Parent = ColourPicker, Size = UDim2.new(0, 156, 0, 0), Position = UDim2.new(1, 20, 0, 0), BackgroundColor3 = Theme.ColourPickerBackground, ClipsDescendants = true }) self:Object("Round", ColourPickerContainer) local MainColour = self:Object("TextButton", { Parent = ColourPickerContainer, AnchorPoint = Vector2.new(0, 0.5), Size = UDim2.new(0, 128, 1, -10), Position = UDim2.new(0, 6, 0.5, 0), BackgroundColor3 = Color3.fromHSV(Hue, 1, 1), Text = "", AutoButtonColor = false }) local MainColourIndicator = self:Object("Frame", { Parent = MainColour, AnchorPoint = Vector2.new(0.5, 0.5), Size = UDim2.new(0, 4, 0, 4), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Color3.fromRGB(255, 255, 255), ZIndex = 2 }) local MainColourIndicatorRound = self:Object("Round", MainColourIndicator) MainColourIndicatorRound.CornerRadius = UDim.new(0, 100) local MainColourRound = self:Object("Round", MainColour) MainColourRound.CornerRadius = UDim.new(0, 5) local WhiteTransparent = self:Object("Frame", { Parent = MainColour, Size = UDim2.new(1, 0, 1, 0), BackgroundColor3 = Color3.fromRGB(255, 255, 255) }) self:Object("Round", WhiteTransparent) local WhiteGradient = self:Object("UIGradient", { Parent = WhiteTransparent, Rotation = 180, Transparency = NumberSequence.new{ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 0) } }) local BlackTransparent = self:Object("Frame", { Parent = MainColour, Size = UDim2.new(1, 0, 1, 0), BackgroundColor3 = Color3.fromRGB(0, 0, 0) }) self:Object("Round", BlackTransparent) local BlackGradient = self:Object("UIGradient", { Parent = BlackTransparent, Rotation = 90, Transparency = NumberSequence.new{ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 0) } }) local HueSlider = self:Object("TextButton", { AutoButtonColor = false, Parent = ColourPickerContainer, Size = UDim2.new(0, 10, 1, -10), AnchorPoint = Vector2.new(1, 0.5), BackgroundColor3 = Color3.fromRGB(255, 255, 255), Text = "", Position = UDim2.new(1, -6, 0.5, 0) }) local HueColourIndicator = self:Object("Frame", { Parent = HueSlider, AnchorPoint = Vector2.new(0.5, 0.5), Size = UDim2.new(1, 0, 0, 4), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundColor3 = Color3.fromRGB(255, 255, 255) }) local HueColourIndicatorRound = self:Object("Round", HueColourIndicator) HueColourIndicatorRound.CornerRadius = UDim.new(0, 100) local HueRound = self:Object("Round", HueSlider) HueRound.CornerRadius = UDim.new(0, 3) self:Object("UIGradient", { Parent = HueSlider, Rotation = 90, Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)), ColorSequenceKeypoint.new(0.167, Color3.fromRGB(255, 255, 0)), ColorSequenceKeypoint.new(0.333, Color3.fromRGB(0, 255, 0)), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 255)), ColorSequenceKeypoint.new(0.667, Color3.fromRGB(0, 0, 255)), ColorSequenceKeypoint.new(0.833, Color3.fromRGB(255, 0, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0)) } }) MainColour.MouseButton1Down:connect(function() MainColourDown = true while MainColourDown and RS.RenderStepped:wait() do local X = math.clamp(((Mouse.X - MainColour.AbsolutePosition.X) / MainColour.AbsoluteSize.X), 0, 1) local Y = 1 - math.clamp(((Mouse.Y - MainColour.AbsolutePosition.Y) / MainColour.AbsoluteSize.Y), 0, 1) XPercent = X YPercent = Y MainColourIndicator:TweenPosition(UDim2.new(XPercent, 0, 1 - YPercent, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.02) Colour = Color3.fromHSV(Hue, XPercent, YPercent) ColourIndicator.BackgroundColor3 = Colour pcall(ColourPickerOptions.Callback, Color3.new(Colour.R, Colour.G, Colour.B)) end end) HueSlider.MouseButton1Down:connect(function() HueDown = true while HueDown and RS.RenderStepped:wait() do Hue = math.clamp(((Mouse.Y - HueSlider.AbsolutePosition.Y) / HueSlider.AbsoluteSize.Y), 0, 1) HueColourIndicator:TweenPosition(UDim2.new(0.5, 0, Hue, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.02) Colour = Color3.fromHSV(Hue, XPercent, YPercent) MainColour.BackgroundColor3 = Color3.fromHSV(Hue, 1, 1) ColourIndicator.BackgroundColor3 = Colour pcall(ColourPickerOptions.Callback, Color3.new(Colour.R, Colour.G, Colour.B)) end end) UIS.InputEnded:connect(function(Mouse) if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then MainColourDown = false HueDown = false end end) AddOptionHoverTweens(ColourPicker) local CondenseColourPicker = TS:Create(ColourPickerContainer, TI(0.1), {Size = UDim2.new(0, 156, 0, 0)}) local ExpandColourPicker = TS:Create(ColourPickerContainer, TI(0.1), {Size = UDim2.new(0, 156, 0, 138)}) local function Reset() State = false end table.insert(self.ColourPickers, {CondenseColourPicker, Reset, ColourPickerContainer}) ColourPicker.MouseButton1Click:connect(function() State = not State if State then ColourPickerContainer.Visible = true table.foreach(self.Dropdowns, function(_, ResetFunction) if ResetFunction ~= Reset then ResetFunction() end end) table.foreach(self.ColourPickers, function(_, ResetFunction) if ResetFunction[2] ~= Reset then ResetFunction[2]() ResetFunction[1]:Play() ResetFunction[3].Visible = false end end) ExpandColourPicker:Play() else Reset() CondenseColourPicker:Play() while CondenseColourPicker.PlaybackState ~= Enum.PlaybackState.Completed and RS.RenderStepped:wait() do end ColourPickerContainer.Visible = false end end) DividerRefresh() local ColourPickerLibrary = {} ColourPickerLibrary.HideElement = function() ColourPicker.Visible = false DividerRefresh() end ColourPickerLibrary.ShowElement = function() ColourPicker.Visible = true DividerRefresh() end ColourPickerLibrary.GetColor = function() return Colour end return ColourPickerLibrary end OptionLibrary.Box = function(_, BoxOptions) BoxOptions = BoxOptions or {} BoxOptions.Name = BoxOptions.Name or "Box" BoxOptions.ClearText = BoxOptions.ClearText or true BoxOptions.Callback = BoxOptions.Callback or function() end local Box = self:Object("MainOptionFrame", Divider) Box.BackgroundColor3 = Theme.OptionBackground Box.Name = "Box" self:Object("Round", Box) local BoxLabel = self:Object("OptionLabel", Box) BoxLabel.Text = BoxOptions.Name BoxLabel.TextColor3 = Theme.OptionText self:Object("UIPadding", { Parent = BoxLabel, PaddingLeft = UDim.new(0, 6) }) local BoxContainer = self:Object("Frame", { Size = UDim2.new(0, 60, 0, 22), Parent = Box, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -4, 0, 4), BackgroundColor3 = Theme.BoxOutline }) self:Object("Round", BoxContainer) local InputBox = self:Object("TextBox", { PlaceholderText = BoxOptions.Placeholder, PlaceholderColor3 = Theme.Placeholder, TextColor3 = Theme.OptionText, Text = "", Font = Enum.Font.SourceSans, TextSize = 16, Parent = BoxContainer, AnchorPoint = Vector2.new(0.5, 0.5), Size = UDim2.new(1, -2, 1, -2), BackgroundColor3 = Theme.OptionBackground, Position = UDim2.new(0.5, 0, 0.5, 0), ClearTextOnFocus = BoxOptions.ClearText }) local PlaceHolderTextBounds = ((BoxOptions.Placeholder and InputBox.TextBounds.X >= 60) and InputBox.TextBounds.X + 10) or 60 BoxContainer.Size = UDim2.new(0, PlaceHolderTextBounds, 0, 22) self:Object("Round", InputBox) InputBox:GetPropertyChangedSignal("Text"):connect(function() local InputBoxSize = InputBox.TextBounds.X if InputBoxSize < PlaceHolderTextBounds - 10 then BoxContainer:TweenSize(UDim2.new(0, PlaceHolderTextBounds, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) elseif InputBoxSize > 190 then InputBox.Text = InputBox.Text:sub(1, -2) BoxContainer:TweenSize(UDim2.new(0, 200, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) else BoxContainer:TweenSize(UDim2.new(0, InputBoxSize + 10, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) end end) local BoxOutlineHover = false local BoxFocused = false BoxContainer.MouseEnter:connect(function() BoxOutlineHover = true TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxHover}):Play() end) BoxContainer.MouseLeave:connect(function() BoxOutlineHover = false if not BoxFocused then TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxOutline}):Play() end end) InputBox.Focused:connect(function() BoxFocused = true TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxClick}):Play() InputBox.FocusLost:connect(function() BoxFocused = false TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = (BoxOutlineHover and Theme.BoxHover) or Theme.BoxOutline}):Play() end) end) InputBox.FocusLost:connect(function() pcall(BoxOptions.Callback, InputBox.Text) end) if BoxOptions.Description then local Description = self:Object("OptionDescription", Box) Description.Text = BoxOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(Box, Description) end local BoxHover = TS:Create(Box, TI(0.1), {BackgroundColor3 = Theme.OptionHover}) local ButtonClick = TS:Create(Box, TI(0.1), {BackgroundColor3 = Theme.OptionClick}) local BoxDefault = TS:Create(Box, TI(0.1), {BackgroundColor3 = Theme.OptionBackground}) Box.MouseEnter:connect(function() BoxHover:Play() end) Box.MouseLeave:connect(function() BoxDefault:Play() end) DividerRefresh() local BoxLibrary = {} BoxLibrary.HideElement = function() Box.Visible = false DividerRefresh() end BoxLibrary.ShowElement = function() Box.Visible = true DividerRefresh() end BoxLibrary.SetText = function(_, Text) InputBox.Text = Text end BoxLibrary.GetText = function() return InputBox.Text end return BoxLibrary end OptionLibrary.SearchDropdown = function(_, SearchDropdownOptions) SearchDropdownOptions = SearchDropdownOptions or {} SearchDropdownOptions.Name = SearchDropdownOptions.Name or "Search Dropdown" SearchDropdownOptions.Options = SearchDropdownOptions.Options or {} SearchDropdownOptions.Callback = SearchDropdownOptions.Callback or function() end SearchDropdownOptions.ClearText = SearchDropdownOptions.ClearText or false local DropdownButtons = {} local Value = nil local State = false local FocusedState = false local SearchDropdown = self:Object("MainOptionFrame", Divider) SearchDropdown.BackgroundColor3 = Theme.OptionBackground SearchDropdown.Name = "Dropdown" self:Object("Round", SearchDropdown) local SearchDropdownLabel = self:Object("OptionLabel", SearchDropdown) SearchDropdownLabel.Text = SearchDropdownOptions.Name SearchDropdownLabel.TextColor3 = Theme.OptionText local SearchDropdownLabelPadding = self:Object("UIPadding", { Parent = SearchDropdownLabel, PaddingLeft = UDim.new(0, 6) }) local OptionsFrameContainer = self:Object("Frame", { Parent = SearchDropdown, Name = "OptionsFrameContainer", Position = UDim2.new(1, 20, 0, 0), BackgroundColor3 = Theme.DropdownOptionsBackground, BorderSizePixel = 0, Size = UDim2.new(0, 100, 0, 0) }) self:Object("Round", OptionsFrameContainer) self:Object("UIPadding", { Parent = OptionsFrameContainer, PaddingTop = UDim.new(0, 5) }) local BoxContainer = self:Object("Frame", { Size = UDim2.new(0, 60, 0, 22), Parent = SearchDropdown, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -4, 0, 4), BackgroundColor3 = Theme.BoxOutline }) self:Object("Round", BoxContainer) local InputBox = self:Object("TextBox", { PlaceholderText = SearchDropdownOptions.Placeholder, PlaceholderColor3 = Theme.Placeholder, TextColor3 = Theme.OptionText, Text = "", Font = Enum.Font.SourceSans, TextSize = 16, Parent = BoxContainer, AnchorPoint = Vector2.new(0.5, 0.5), Size = UDim2.new(1, -2, 1, -2), BackgroundColor3 = Theme.OptionBackground, Position = UDim2.new(0.5, 0, 0.5, 0), ClearTextOnFocus = SearchDropdownOptions.ClearText }) local PlaceHolderTextBounds = ((SearchDropdownOptions.Placeholder and InputBox.TextBounds.X >= 60) and InputBox.TextBounds.X + 10) or 60 BoxContainer.Size = UDim2.new(0, PlaceHolderTextBounds, 0, 22) self:Object("Round", InputBox) local BoxOutlineHover = false local BoxFocused = false BoxContainer.MouseEnter:connect(function() BoxOutlineHover = true TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxHover}):Play() end) BoxContainer.MouseLeave:connect(function() BoxOutlineHover = false if not BoxFocused then TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxOutline}):Play() end end) InputBox.Focused:connect(function() BoxFocused = true TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = Theme.BoxClick}):Play() InputBox.FocusLost:connect(function() BoxFocused = false TS:Create(BoxContainer, TI(0.1), {BackgroundColor3 = (BoxOutlineHover and Theme.BoxHover) or Theme.BoxOutline}):Play() end) end) local OptionsFrame = self:Object("ScrollingFrame", { Name = "OptionsFrame", Parent = OptionsFrameContainer, BorderSizePixel = 0, BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, -5), CanvasSize = UDim2.new(0, 0, 0, 0), ScrollingDirection = Enum.ScrollingDirection.Y, ScrollBarThickness = 0 }) local OptionsLayout = self:Object("UIListLayout", { Parent = OptionsFrame, HorizontalAlignment = Enum.HorizontalAlignment.Left }) local RefreshOptionsFrame = function() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, OptionsLayout.AbsoluteContentSize.Y) end local CondenseOptionsFrame = TS:Create(OptionsFrameContainer, TI(0.1), {Size = UDim2.new(0, 150, 0, 0)}) local AddDropdownButton = function(Name) local Button = self:Object("TextButton", { Parent = OptionsFrame, Size = UDim2.new(1, 0, 0, 20), BorderSizePixel = 0, Text = tostring(Name), BackgroundColor3 = Theme.DropdownOption, Font = Enum.Font.SourceSansSemibold, TextColor3 = Theme.DropdownText, TextSize = 16, AutoButtonColor = false, TextXAlignment = Enum.TextXAlignment.Left }) self:Object("UIPadding", { Parent = Button, PaddingLeft = UDim.new(0, 5) }) local OptionHover = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOptionHover}) local OptionClick = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOptionClick}) local OptionDefault = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.DropdownOption}) local Hovered = false Button.MouseEnter:connect(function() Hovered = true OptionHover:Play() end) Button.MouseLeave:connect(function() Hovered = false OptionDefault:Play() end) Button.MouseButton1Down:connect(function() OptionClick:Play() UIS.InputEnded:connect(function(inputType) if inputType.UserInputType == Enum.UserInputType.MouseButton1 then if Hovered then OptionHover:Play() else OptionDefault:Play() end end end) end) Button.MouseButton1Click:connect(function() SearchDropdownLabel.Text = SearchDropdownOptions.Name .. [[ \ ]] .. tostring(Name) pcall(SearchDropdownOptions.Callback, tostring(Name)) CondenseOptionsFrame:Play() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) State = false Value = tostring(Name) FocusedState = false end) table.insert(DropdownButtons, {Name = tostring(Name), Button = Button}) end table.foreach(SearchDropdownOptions.Options, function(_, Name) AddDropdownButton(Name) end) InputBox:GetPropertyChangedSignal("Text"):connect(function() table.foreach(DropdownButtons, function(_, OptionButton) if string.find(OptionButton.Name, InputBox.Text) then OptionButton.Button.Visible = true else OptionButton.Button.Visible = false end end) RefreshOptionsFrame() OptionsFrameContainer.Size = UDim2.new(0, 150, 0, OptionsLayout.AbsoluteContentSize.Y + 10) local InputBoxSize = InputBox.TextBounds.X if InputBoxSize < PlaceHolderTextBounds - 10 then BoxContainer:TweenSize(UDim2.new(0, PlaceHolderTextBounds, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) elseif InputBoxSize > 190 then InputBox.Text = InputBox.Text:sub(1, -2) BoxContainer:TweenSize(UDim2.new(0, 200, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) else BoxContainer:TweenSize(UDim2.new(0, InputBoxSize + 10, 0, 22), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.01) end end) if SearchDropdownOptions.Description then local Description = self:Object("OptionDescription", SearchDropdown) Description.Text = SearchDropdownOptions.Description Description.TextColor3 = Theme.OptionDescription local DescriptionPadding = self:Object("UIPadding", { Parent = Description, PaddingLeft = UDim.new(0, 6) }) AddDescriptionTweens(SearchDropdown, Description) end local function Reset() OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) CondenseOptionsFrame:Play() State = false end InputBox.Focused:connect(function() FocusedState = not FocusedState table.foreach(self.Dropdowns, function(_, ResetFunction) if ResetFunction ~= Reset then ResetFunction() end end) table.foreach(self.ColourPickers, function(_, ResetFunction) if ResetFunction[2] ~= Reset then ResetFunction[2]() ResetFunction[1]:Play() ResetFunction[3].Visible = false end end) if FocusedState then RefreshOptionsFrame() TS:Create(OptionsFrameContainer, TI(0.1), {Size = UDim2.new(0, 150, 0, ((OptionsLayout.AbsoluteContentSize.Y < 100) and (OptionsLayout.AbsoluteContentSize.Y + 10)) or 110)}):Play() else OptionsFrame.CanvasSize = UDim2.new(0, 0, 0, 0) CondenseOptionsFrame:Play() end end) table.insert(self.Dropdowns, Reset) AddOptionHoverTweens(SearchDropdown) DividerRefresh() local SearchDropdownLibrary = {} SearchDropdownLibrary.HideElement = function() SearchDropdown.Visible = false DividerRefresh() end SearchDropdownLibrary.ShowElement = function() SearchDropdown.Visible = true DividerRefresh() end return SearchDropdownLibrary end return OptionLibrary end return DividerLibrary end return TabsLibrary end return Library