Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Library = {}
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local function CreateTween(instance, properties, duration, style, direction)
- local info = TweenInfo.new(duration or 0.3, style or Enum.EasingStyle.Quart, direction or Enum.EasingDirection.Out)
- return TweenService:Create(instance, info, properties)
- end
- local function MakeDraggable(frame, dragHandle)
- local dragging = false
- local dragStart, startPos
- dragHandle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- end
- local function CreateInstance(class, properties, parent)
- local inst = Instance.new(class)
- for k, v in pairs(properties) do
- inst[k] = v
- end
- if parent then inst.Parent = parent end
- return inst
- end
- local function Round(frame, radius)
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, radius or 8)
- corner.Parent = frame
- return corner
- end
- local function Stroke(frame, color, thickness)
- local stroke = Instance.new("UIStroke")
- stroke.Color = color or Color3.fromRGB(60, 60, 70)
- stroke.Thickness = thickness or 1
- stroke.Parent = frame
- return stroke
- end
- local COLORS = {
- Background = Color3.fromRGB(10, 10, 14),
- Surface = Color3.fromRGB(16, 16, 22),
- Elevated = Color3.fromRGB(22, 22, 30),
- Border = Color3.fromRGB(40, 40, 55),
- Accent = Color3.fromRGB(110, 86, 255),
- AccentDim = Color3.fromRGB(70, 52, 180),
- Text = Color3.fromRGB(240, 240, 255),
- TextDim = Color3.fromRGB(140, 140, 165),
- TextMuted = Color3.fromRGB(80, 80, 100),
- Success = Color3.fromRGB(72, 200, 140),
- Danger = Color3.fromRGB(255, 80, 100),
- }
- function Library.Create(config)
- config = config or {}
- local ScreenGui = CreateInstance("ScreenGui", {
- Name = "LibraryUI",
- ResetOnSpawn = false,
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
- })
- local success = pcall(function()
- ScreenGui.Parent = game:GetService("CoreGui")
- end)
- if not success then
- ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- end
- local LoaderActive = false
- local LoaderFrame, LoaderLeft, LoaderRight, LoaderText, LoaderSub
- if config.Loader then
- LoaderActive = true
- local Overlay = CreateInstance("Frame", {
- Name = "LoaderOverlay",
- Size = UDim2.new(1, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = COLORS.Background,
- BorderSizePixel = 0,
- ZIndex = 100,
- }, ScreenGui)
- LoaderLeft = CreateInstance("Frame", {
- Name = "LoaderLeft",
- Size = UDim2.new(0.5, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = COLORS.Background,
- BorderSizePixel = 0,
- ZIndex = 101,
- }, Overlay)
- LoaderRight = CreateInstance("Frame", {
- Name = "LoaderRight",
- Size = UDim2.new(0.5, 0, 1, 0),
- Position = UDim2.new(0.5, 0, 0, 0),
- BackgroundColor3 = COLORS.Background,
- BorderSizePixel = 0,
- ZIndex = 101,
- }, Overlay)
- local Center = CreateInstance("Frame", {
- Size = UDim2.new(0, 400, 0, 120),
- Position = UDim2.new(0.5, -200, 0.5, -60),
- BackgroundTransparency = 1,
- ZIndex = 102,
- }, Overlay)
- LoaderText = CreateInstance("TextLabel", {
- Size = UDim2.new(1, 0, 0, 40),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundTransparency = 1,
- Text = config.Title or "Loading",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.GothamBold,
- TextSize = 26,
- ZIndex = 103,
- }, Center)
- LoaderSub = CreateInstance("TextLabel", {
- Size = UDim2.new(1, 0, 0, 24),
- Position = UDim2.new(0, 0, 0, 46),
- BackgroundTransparency = 1,
- Text = "Initializing...",
- TextColor3 = COLORS.TextDim,
- Font = Enum.Font.Gotham,
- TextSize = 14,
- ZIndex = 103,
- }, Center)
- local BarBg = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 3),
- Position = UDim2.new(0, 0, 0, 90),
- BackgroundColor3 = COLORS.Border,
- BorderSizePixel = 0,
- ZIndex = 103,
- }, Center)
- Round(BarBg, 2)
- local BarFill = CreateInstance("Frame", {
- Size = UDim2.new(0, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = COLORS.Accent,
- BorderSizePixel = 0,
- ZIndex = 104,
- }, BarBg)
- Round(BarFill, 2)
- local barTween = CreateTween(BarFill, {Size = UDim2.new(0.7, 0, 1, 0)}, 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
- barTween:Play()
- local Loader = {}
- function Loader:Start()
- LoaderActive = true
- end
- function Loader:SetText(text)
- if LoaderSub then
- LoaderSub.Text = text
- local fade = CreateTween(LoaderSub, {TextTransparency = 0}, 0.2)
- fade:Play()
- end
- end
- function Loader:End()
- LoaderActive = false
- CreateTween(BarFill, {Size = UDim2.new(1, 0, 1, 0)}, 0.4, Enum.EasingStyle.Quart):Play()
- task.wait(0.5)
- local fadeText = CreateTween(LoaderText, {TextTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
- local fadeSub = CreateTween(LoaderSub, {TextTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
- local fadeBar = CreateTween(BarBg, {BackgroundTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
- local fadeBarFill = CreateTween(BarFill, {BackgroundTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
- fadeText:Play()
- fadeSub:Play()
- fadeBar:Play()
- fadeBarFill:Play()
- task.wait(0.4)
- local splitLeft = CreateTween(LoaderLeft, {Position = UDim2.new(-0.5, 0, 0, 0)}, 0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
- local splitRight = CreateTween(LoaderRight, {Position = UDim2.new(1, 0, 0, 0)}, 0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
- splitLeft:Play()
- splitRight:Play()
- task.wait(0.75)
- Overlay:Destroy()
- end
- config._Loader = Loader
- end
- local WindowLib = {}
- local MainFrame = CreateInstance("Frame", {
- Name = "MainWindow",
- Size = UDim2.new(0, 620, 0, 460),
- Position = UDim2.new(0.5, -310, 0.5, -230),
- BackgroundColor3 = COLORS.Background,
- BorderSizePixel = 0,
- ClipsDescendants = false,
- }, ScreenGui)
- Round(MainFrame, 12)
- Stroke(MainFrame, COLORS.Border, 1)
- MainFrame.BackgroundTransparency = 1
- CreateTween(MainFrame, {BackgroundTransparency = 0}, 0.4, Enum.EasingStyle.Quart):Play()
- local Shadow = CreateInstance("ImageLabel", {
- Size = UDim2.new(1, 40, 1, 40),
- Position = UDim2.new(0, -20, 0, -20),
- BackgroundTransparency = 1,
- Image = "rbxassetid://5028857084",
- ImageColor3 = Color3.fromRGB(0, 0, 0),
- ImageTransparency = 0.6,
- ScaleType = Enum.ScaleType.Slice,
- SliceCenter = Rect.new(24, 24, 276, 276),
- ZIndex = 0,
- }, MainFrame)
- local TitleBar = CreateInstance("Frame", {
- Name = "TitleBar",
- Size = UDim2.new(1, 0, 0, 46),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = COLORS.Surface,
- BorderSizePixel = 0,
- ZIndex = 2,
- }, MainFrame)
- Round(TitleBar, 12)
- local TitleBarFix = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 12),
- Position = UDim2.new(0, 0, 1, -12),
- BackgroundColor3 = COLORS.Surface,
- BorderSizePixel = 0,
- ZIndex = 2,
- }, TitleBar)
- local AccentLine = CreateInstance("Frame", {
- Size = UDim2.new(0, 3, 0, 22),
- Position = UDim2.new(0, 14, 0, 12),
- BackgroundColor3 = COLORS.Accent,
- BorderSizePixel = 0,
- ZIndex = 3,
- }, TitleBar)
- Round(AccentLine, 2)
- local TitleLabel = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 300, 0, 46),
- Position = UDim2.new(0, 26, 0, 0),
- BackgroundTransparency = 1,
- Text = config.Title or "Library",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.GothamBold,
- TextSize = 15,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 3,
- }, TitleBar)
- local SubLabel = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 300, 0, 46),
- Position = UDim2.new(0, 26, 0, 18),
- BackgroundTransparency = 1,
- Text = (config.SubTitle or "") .. (config.Version and (" v" .. config.Version) or ""),
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.Gotham,
- TextSize = 11,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 3,
- }, TitleBar)
- local ControlsFrame = CreateInstance("Frame", {
- Size = UDim2.new(0, 60, 0, 46),
- Position = UDim2.new(1, -66, 0, 0),
- BackgroundTransparency = 1,
- ZIndex = 3,
- }, TitleBar)
- local function MakeControlBtn(label, color, xPos)
- local Btn = CreateInstance("TextButton", {
- Size = UDim2.new(0, 16, 0, 16),
- Position = UDim2.new(0, xPos, 0.5, -8),
- BackgroundColor3 = color,
- Text = "",
- BorderSizePixel = 0,
- ZIndex = 4,
- }, ControlsFrame)
- Round(Btn, 8)
- local Dot = CreateInstance("TextLabel", {
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- Text = label,
- TextColor3 = Color3.fromRGB(0, 0, 0),
- Font = Enum.Font.GothamBold,
- TextSize = 9,
- TextTransparency = 1,
- ZIndex = 5,
- }, Btn)
- Btn.MouseEnter:Connect(function()
- CreateTween(Dot, {TextTransparency = 0}, 0.15):Play()
- CreateTween(Btn, {BackgroundColor3 = color:lerp(Color3.fromRGB(255,255,255), 0.2)}, 0.15):Play()
- end)
- Btn.MouseLeave:Connect(function()
- CreateTween(Dot, {TextTransparency = 1}, 0.15):Play()
- CreateTween(Btn, {BackgroundColor3 = color}, 0.15):Play()
- end)
- return Btn
- end
- local MinBtn = MakeControlBtn("—", Color3.fromRGB(255, 190, 50), 0)
- local CloseBtn = MakeControlBtn("✕", Color3.fromRGB(255, 75, 75), 26)
- local minimized = false
- local ContentFrame
- CloseBtn.MouseButton1Click:Connect(function()
- CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 0), Position = UDim2.new(0.5, -310, 0.5, 0)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.In):Play()
- task.wait(0.32)
- ScreenGui:Destroy()
- end)
- MinBtn.MouseButton1Click:Connect(function()
- minimized = not minimized
- if minimized then
- CreateTween(ContentFrame, {Size = UDim2.new(1, 0, 0, 0)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
- CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 46)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
- else
- CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 460)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
- task.wait(0.1)
- CreateTween(ContentFrame, {Size = UDim2.new(1, 0, 1, -46)}, 0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
- end
- end)
- MakeDraggable(MainFrame, TitleBar)
- ContentFrame = CreateInstance("Frame", {
- Name = "Content",
- Size = UDim2.new(1, 0, 1, -46),
- Position = UDim2.new(0, 0, 0, 46),
- BackgroundTransparency = 1,
- ClipsDescendants = true,
- ZIndex = 2,
- }, MainFrame)
- local TabBar = CreateInstance("Frame", {
- Name = "TabBar",
- Size = UDim2.new(0, 140, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = COLORS.Surface,
- BorderSizePixel = 0,
- ZIndex = 2,
- }, ContentFrame)
- local TabBarFix = CreateInstance("Frame", {
- Size = UDim2.new(0, 4, 1, 0),
- Position = UDim2.new(1, -4, 0, 0),
- BackgroundColor3 = COLORS.Surface,
- BorderSizePixel = 0,
- ZIndex = 2,
- }, TabBar)
- local TabList = CreateInstance("ScrollingFrame", {
- Size = UDim2.new(1, 0, 1, -10),
- Position = UDim2.new(0, 0, 0, 8),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- ScrollBarThickness = 0,
- ZIndex = 3,
- }, TabBar)
- local TabListLayout = CreateInstance("UIListLayout", {
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 4),
- }, TabList)
- local TabListPad = CreateInstance("UIPadding", {
- PaddingLeft = UDim.new(0, 8),
- PaddingRight = UDim.new(0, 8),
- }, TabList)
- local TabDivider = CreateInstance("Frame", {
- Size = UDim2.new(0, 1, 1, 0),
- Position = UDim2.new(1, 0, 0, 0),
- BackgroundColor3 = COLORS.Border,
- BorderSizePixel = 0,
- ZIndex = 3,
- }, TabBar)
- local PageContainer = CreateInstance("Frame", {
- Name = "Pages",
- Size = UDim2.new(1, -140, 1, 0),
- Position = UDim2.new(0, 140, 0, 0),
- BackgroundTransparency = 1,
- ClipsDescendants = true,
- ZIndex = 2,
- }, ContentFrame)
- local activeTab = nil
- local tabs = {}
- MainFrame.Size = UDim2.new(0, 0, 0, 0)
- MainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
- CreateTween(MainFrame, {
- Size = UDim2.new(0, 620, 0, 460),
- Position = UDim2.new(0.5, -310, 0.5, -230),
- }, 0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out):Play()
- local Window = {}
- Window._ScreenGui = ScreenGui
- Window._Loader = config._Loader
- if config.Loader and config._Loader then
- Window.Loader = config._Loader
- end
- function Window:Tab(tabConfig)
- tabConfig = tabConfig or {}
- local tabName = tabConfig.Name or "Tab"
- local tabIcon = tabConfig.Icon or ""
- local TabBtn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 0, 34),
- BackgroundColor3 = COLORS.Elevated,
- BackgroundTransparency = 1,
- Text = "",
- BorderSizePixel = 0,
- AutoButtonColor = false,
- ZIndex = 4,
- }, TabList)
- Round(TabBtn, 8)
- local TabIcon = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 28, 1, 0),
- Position = UDim2.new(0, 8, 0, 0),
- BackgroundTransparency = 1,
- Text = tabIcon,
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.GothamBold,
- TextSize = 14,
- ZIndex = 5,
- }, TabBtn)
- local TabLabel = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -40, 1, 0),
- Position = UDim2.new(0, 36, 0, 0),
- BackgroundTransparency = 1,
- Text = tabName,
- TextColor3 = COLORS.TextDim,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 5,
- }, TabBtn)
- local ActiveBar = CreateInstance("Frame", {
- Size = UDim2.new(0, 3, 0, 16),
- Position = UDim2.new(0, 0, 0.5, -8),
- BackgroundColor3 = COLORS.Accent,
- BorderSizePixel = 0,
- BackgroundTransparency = 1,
- ZIndex = 5,
- }, TabBtn)
- Round(ActiveBar, 2)
- local Page = CreateInstance("ScrollingFrame", {
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- ScrollBarThickness = 3,
- ScrollBarImageColor3 = COLORS.Accent,
- Visible = false,
- ZIndex = 3,
- }, PageContainer)
- local PageLayout = CreateInstance("UIListLayout", {
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 0),
- }, Page)
- local PagePad = CreateInstance("UIPadding", {
- PaddingTop = UDim.new(0, 10),
- PaddingLeft = UDim.new(0, 12),
- PaddingRight = UDim.new(0, 14),
- PaddingBottom = UDim.new(0, 12),
- }, Page)
- PageLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- Page.CanvasSize = UDim2.new(0, 0, 0, PageLayout.AbsoluteContentSize.Y + 22)
- end)
- local tab = {_Page = Page, _TabBtn = TabBtn}
- local function Activate()
- if activeTab and activeTab ~= tab then
- local prev = activeTab
- prev._Page.Visible = false
- CreateTween(prev._TabBtn, {BackgroundTransparency = 1}, 0.2):Play()
- local prevLabel = prev._TabBtn:FindFirstChildWhichIsA("TextLabel")
- local prevIcon = prev._TabBtn:FindFirstChild("TextLabel")
- for _, v in pairs(prev._TabBtn:GetChildren()) do
- if v:IsA("TextLabel") then
- CreateTween(v, {TextColor3 = COLORS.TextDim}, 0.2):Play()
- end
- if v.Name == "Frame" then
- CreateTween(v, {BackgroundTransparency = 1}, 0.2):Play()
- end
- end
- CreateTween(ActiveBar, {BackgroundTransparency = 1}, 0.2):Play()
- end
- activeTab = tab
- Page.Visible = true
- CreateTween(TabBtn, {BackgroundTransparency = 0}, 0.2):Play()
- CreateTween(TabLabel, {TextColor3 = COLORS.Text, Font = Enum.Font.GothamBold}, 0.2):Play()
- CreateTween(TabIcon, {TextColor3 = COLORS.Accent}, 0.2):Play()
- CreateTween(ActiveBar, {BackgroundTransparency = 0}, 0.2):Play()
- end
- TabBtn.MouseButton1Click:Connect(Activate)
- TabBtn.MouseEnter:Connect(function()
- if activeTab ~= tab then
- CreateTween(TabBtn, {BackgroundTransparency = 0.7}, 0.15):Play()
- end
- end)
- TabBtn.MouseLeave:Connect(function()
- if activeTab ~= tab then
- CreateTween(TabBtn, {BackgroundTransparency = 1}, 0.15):Play()
- end
- end)
- if #tabs == 0 then
- Activate()
- end
- table.insert(tabs, tab)
- function tab:Section(sectionConfig)
- sectionConfig = sectionConfig or {}
- local sectionName = sectionConfig.Name or "Section"
- local SectionWrap = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 0),
- BackgroundTransparency = 1,
- AutomaticSize = Enum.AutomaticSize.Y,
- ZIndex = 4,
- }, Page)
- local SectionHeader = CreateInstance("TextLabel", {
- Size = UDim2.new(1, 0, 0, 22),
- BackgroundTransparency = 1,
- Text = sectionName,
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.GothamBold,
- TextSize = 11,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 5,
- }, SectionWrap)
- local Divider = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 1),
- Position = UDim2.new(0, 0, 0, 22),
- BackgroundColor3 = COLORS.Border,
- BorderSizePixel = 0,
- ZIndex = 5,
- }, SectionWrap)
- local ItemList = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 0),
- Position = UDim2.new(0, 0, 0, 28),
- BackgroundTransparency = 1,
- AutomaticSize = Enum.AutomaticSize.Y,
- ZIndex = 4,
- }, SectionWrap)
- local ItemLayout = CreateInstance("UIListLayout", {
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 4),
- }, ItemList)
- local BottomPad = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 12),
- BackgroundTransparency = 1,
- ZIndex = 4,
- LayoutOrder = 999,
- }, ItemList)
- local section = {_List = ItemList}
- local function MakeItem(height)
- local item = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, height or 36),
- BackgroundColor3 = COLORS.Elevated,
- BorderSizePixel = 0,
- ZIndex = 5,
- }, ItemList)
- Round(item, 7)
- return item
- end
- function section:Button(btnConfig)
- btnConfig = btnConfig or {}
- local item = MakeItem(36)
- local Btn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- Text = "",
- ZIndex = 6,
- }, item)
- local Label = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -16, 1, 0),
- Position = UDim2.new(0, 12, 0, 0),
- BackgroundTransparency = 1,
- Text = btnConfig.Name or "Button",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 6,
- }, item)
- local Arrow = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 20, 1, 0),
- Position = UDim2.new(1, -28, 0, 0),
- BackgroundTransparency = 1,
- Text = "›",
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.GothamBold,
- TextSize = 16,
- ZIndex = 6,
- }, item)
- Btn.MouseEnter:Connect(function()
- CreateTween(item, {BackgroundColor3 = COLORS.Accent:lerp(COLORS.Elevated, 0.85)}, 0.15):Play()
- CreateTween(Label, {TextColor3 = COLORS.Accent}, 0.15):Play()
- end)
- Btn.MouseLeave:Connect(function()
- CreateTween(item, {BackgroundColor3 = COLORS.Elevated}, 0.15):Play()
- CreateTween(Label, {TextColor3 = COLORS.Text}, 0.15):Play()
- end)
- Btn.MouseButton1Click:Connect(function()
- CreateTween(item, {BackgroundColor3 = COLORS.Accent:lerp(COLORS.Elevated, 0.6)}, 0.08):Play()
- task.wait(0.1)
- CreateTween(item, {BackgroundColor3 = COLORS.Elevated}, 0.2):Play()
- if btnConfig.Callback then btnConfig.Callback() end
- end)
- end
- function section:Toggle(toggleConfig)
- toggleConfig = toggleConfig or {}
- local item = MakeItem(36)
- local state = toggleConfig.Default or false
- local Label = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -60, 1, 0),
- Position = UDim2.new(0, 12, 0, 0),
- BackgroundTransparency = 1,
- Text = toggleConfig.Name or "Toggle",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 6,
- }, item)
- local TrackBg = CreateInstance("Frame", {
- Size = UDim2.new(0, 36, 0, 18),
- Position = UDim2.new(1, -46, 0.5, -9),
- BackgroundColor3 = state and COLORS.Accent or COLORS.Border,
- BorderSizePixel = 0,
- ZIndex = 6,
- }, item)
- Round(TrackBg, 9)
- local Knob = CreateInstance("Frame", {
- Size = UDim2.new(0, 14, 0, 14),
- Position = state and UDim2.new(0, 20, 0.5, -7) or UDim2.new(0, 2, 0.5, -7),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0,
- ZIndex = 7,
- }, TrackBg)
- Round(Knob, 7)
- local Btn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- Text = "",
- ZIndex = 8,
- }, item)
- Btn.MouseButton1Click:Connect(function()
- state = not state
- CreateTween(TrackBg, {BackgroundColor3 = state and COLORS.Accent or COLORS.Border}, 0.2):Play()
- CreateTween(Knob, {Position = state and UDim2.new(0, 20, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)}, 0.2, Enum.EasingStyle.Quart):Play()
- if toggleConfig.Callback then toggleConfig.Callback(state) end
- end)
- end
- function section:Dropdown(ddConfig)
- ddConfig = ddConfig or {}
- local options = ddConfig.Options or {}
- local selected = ddConfig.Default or options[1] or "Select..."
- local open = false
- local item = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 36),
- BackgroundColor3 = COLORS.Elevated,
- BorderSizePixel = 0,
- ZIndex = 5,
- ClipsDescendants = false,
- }, ItemList)
- Round(item, 7)
- local Label = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -16, 0, 36),
- Position = UDim2.new(0, 12, 0, 0),
- BackgroundTransparency = 1,
- Text = ddConfig.Name or "Dropdown",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 6,
- }, item)
- local SelLabel = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 120, 0, 36),
- Position = UDim2.new(1, -136, 0, 0),
- BackgroundTransparency = 1,
- Text = selected,
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Right,
- ZIndex = 6,
- }, item)
- local Arrow = CreateInstance("TextLabel", {
- Size = UDim2.new(0, 20, 0, 36),
- Position = UDim2.new(1, -24, 0, 0),
- BackgroundTransparency = 1,
- Text = "▾",
- TextColor3 = COLORS.TextMuted,
- Font = Enum.Font.GothamBold,
- TextSize = 12,
- ZIndex = 6,
- }, item)
- local Dropdown = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 0),
- Position = UDim2.new(0, 0, 1, 4),
- BackgroundColor3 = COLORS.Surface,
- BorderSizePixel = 0,
- ClipsDescendants = true,
- ZIndex = 20,
- }, item)
- Round(Dropdown, 7)
- Stroke(Dropdown, COLORS.Border, 1)
- local DdLayout = CreateInstance("UIListLayout", {
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 2),
- }, Dropdown)
- local DdPad = CreateInstance("UIPadding", {
- PaddingTop = UDim.new(0, 4),
- PaddingBottom = UDim.new(0, 4),
- PaddingLeft = UDim.new(0, 4),
- PaddingRight = UDim.new(0, 4),
- }, Dropdown)
- local totalHeight = #options * 30 + 10
- for _, opt in ipairs(options) do
- local OptBtn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 0, 28),
- BackgroundColor3 = COLORS.Elevated,
- BackgroundTransparency = 1,
- Text = opt,
- TextColor3 = COLORS.TextDim,
- Font = Enum.Font.Gotham,
- TextSize = 12,
- ZIndex = 21,
- }, Dropdown)
- Round(OptBtn, 6)
- OptBtn.MouseEnter:Connect(function()
- CreateTween(OptBtn, {BackgroundTransparency = 0, TextColor3 = COLORS.Text}, 0.15):Play()
- end)
- OptBtn.MouseLeave:Connect(function()
- CreateTween(OptBtn, {BackgroundTransparency = 1, TextColor3 = COLORS.TextDim}, 0.15):Play()
- end)
- OptBtn.MouseButton1Click:Connect(function()
- selected = opt
- SelLabel.Text = opt
- open = false
- CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, 0)}, 0.2, Enum.EasingStyle.Quart):Play()
- CreateTween(Arrow, {Rotation = 0}, 0.2):Play()
- if ddConfig.Callback then ddConfig.Callback(opt) end
- end)
- end
- local MainBtn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 0, 36),
- BackgroundTransparency = 1,
- Text = "",
- ZIndex = 7,
- }, item)
- MainBtn.MouseButton1Click:Connect(function()
- open = not open
- if open then
- CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, totalHeight)}, 0.25, Enum.EasingStyle.Quart):Play()
- CreateTween(Arrow, {Rotation = 180}, 0.2):Play()
- else
- CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, 0)}, 0.2, Enum.EasingStyle.Quart):Play()
- CreateTween(Arrow, {Rotation = 0}, 0.2):Play()
- end
- end)
- end
- function section:Input(inputConfig)
- inputConfig = inputConfig or {}
- local item = MakeItem(36)
- local Label = CreateInstance("TextLabel", {
- Size = UDim2.new(0.45, 0, 1, 0),
- Position = UDim2.new(0, 12, 0, 0),
- BackgroundTransparency = 1,
- Text = inputConfig.Name or "Input",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 6,
- }, item)
- local InputBg = CreateInstance("Frame", {
- Size = UDim2.new(0.5, -8, 0, 24),
- Position = UDim2.new(0.5, 0, 0.5, -12),
- BackgroundColor3 = COLORS.Background,
- BorderSizePixel = 0,
- ZIndex = 6,
- }, item)
- Round(InputBg, 6)
- Stroke(InputBg, COLORS.Border, 1)
- local TextBox = CreateInstance("TextBox", {
- Size = UDim2.new(1, -16, 1, 0),
- Position = UDim2.new(0, 8, 0, 0),
- BackgroundTransparency = 1,
- Text = inputConfig.Default or "",
- PlaceholderText = inputConfig.Placeholder or "Type here...",
- PlaceholderColor3 = COLORS.TextMuted,
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left,
- ClearTextOnFocus = false,
- ZIndex = 7,
- }, InputBg)
- TextBox.Focused:Connect(function()
- CreateTween(InputBg, {BackgroundColor3 = COLORS.Elevated}, 0.15):Play()
- end)
- TextBox.FocusLost:Connect(function(enter)
- CreateTween(InputBg, {BackgroundColor3 = COLORS.Background}, 0.15):Play()
- if inputConfig.Callback then inputConfig.Callback(TextBox.Text, enter) end
- end)
- end
- function section:Slider(sliderConfig)
- sliderConfig = sliderConfig or {}
- local min = sliderConfig.Min or 0
- local max = sliderConfig.Max or 100
- local val = sliderConfig.Default or min
- local item = MakeItem(46)
- local Label = CreateInstance("TextLabel", {
- Size = UDim2.new(0.7, 0, 0, 22),
- Position = UDim2.new(0, 12, 0, 4),
- BackgroundTransparency = 1,
- Text = sliderConfig.Name or "Slider",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.Gotham,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- ZIndex = 6,
- }, item)
- local ValLabel = CreateInstance("TextLabel", {
- Size = UDim2.new(0.3, -12, 0, 22),
- Position = UDim2.new(0.7, 0, 0, 4),
- BackgroundTransparency = 1,
- Text = tostring(val),
- TextColor3 = COLORS.Accent,
- Font = Enum.Font.GothamBold,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Right,
- ZIndex = 6,
- }, item)
- local TrackBg = CreateInstance("Frame", {
- Size = UDim2.new(1, -24, 0, 4),
- Position = UDim2.new(0, 12, 0, 34),
- BackgroundColor3 = COLORS.Border,
- BorderSizePixel = 0,
- ZIndex = 6,
- }, item)
- Round(TrackBg, 2)
- local Fill = CreateInstance("Frame", {
- Size = UDim2.new((val - min) / (max - min), 0, 1, 0),
- BackgroundColor3 = COLORS.Accent,
- BorderSizePixel = 0,
- ZIndex = 7,
- }, TrackBg)
- Round(Fill, 2)
- local Knob = CreateInstance("Frame", {
- Size = UDim2.new(0, 12, 0, 12),
- Position = UDim2.new((val - min) / (max - min), -6, 0.5, -6),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0,
- ZIndex = 8,
- }, TrackBg)
- Round(Knob, 6)
- local draggingSlider = false
- local SliderBtn = CreateInstance("TextButton", {
- Size = UDim2.new(1, 0, 0, 20),
- Position = UDim2.new(0, 0, 0, -8),
- BackgroundTransparency = 1,
- Text = "",
- ZIndex = 9,
- }, TrackBg)
- local function UpdateSlider(inputPos)
- local abs = TrackBg.AbsolutePosition
- local size = TrackBg.AbsoluteSize
- local rel = math.clamp((inputPos.X - abs.X) / size.X, 0, 1)
- val = math.floor(min + rel * (max - min))
- ValLabel.Text = tostring(val)
- CreateTween(Fill, {Size = UDim2.new(rel, 0, 1, 0)}, 0.05):Play()
- CreateTween(Knob, {Position = UDim2.new(rel, -6, 0.5, -6)}, 0.05):Play()
- if sliderConfig.Callback then sliderConfig.Callback(val) end
- end
- SliderBtn.MouseButton1Down:Connect(function()
- draggingSlider = true
- UpdateSlider(UserInputService:GetMouseLocation())
- end)
- UserInputService.InputChanged:Connect(function(input)
- if draggingSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
- UpdateSlider(UserInputService:GetMouseLocation())
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- draggingSlider = false
- end
- end)
- end
- function section:Paragraph(paraConfig)
- paraConfig = paraConfig or {}
- local item = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 0),
- AutomaticSize = Enum.AutomaticSize.Y,
- BackgroundColor3 = COLORS.Elevated,
- BorderSizePixel = 0,
- ZIndex = 5,
- }, ItemList)
- Round(item, 7)
- local TitleLbl = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -24, 0, 0),
- AutomaticSize = Enum.AutomaticSize.Y,
- Position = UDim2.new(0, 12, 0, 10),
- BackgroundTransparency = 1,
- Text = paraConfig.Title or "",
- TextColor3 = COLORS.Text,
- Font = Enum.Font.GothamBold,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left,
- TextWrapped = true,
- ZIndex = 6,
- }, item)
- local ContentLbl = CreateInstance("TextLabel", {
- Size = UDim2.new(1, -24, 0, 0),
- AutomaticSize = Enum.AutomaticSize.Y,
- Position = UDim2.new(0, 12, 0, 28),
- BackgroundTransparency = 1,
- Text = paraConfig.Content or "",
- TextColor3 = COLORS.TextDim,
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left,
- TextWrapped = true,
- ZIndex = 6,
- }, item)
- local PadBot = CreateInstance("Frame", {
- Size = UDim2.new(1, 0, 0, 10),
- Position = UDim2.new(0, 0, 1, 0),
- BackgroundTransparency = 1,
- ZIndex = 5,
- }, item)
- end
- return section
- end
- function tab:Button(btnConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Button(btnConfig)
- end
- function tab:Toggle(toggleConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Toggle(toggleConfig)
- end
- function tab:Dropdown(ddConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Dropdown(ddConfig)
- end
- function tab:Input(inputConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Input(inputConfig)
- end
- function tab:Slider(sliderConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Slider(sliderConfig)
- end
- function tab:Paragraph(paraConfig)
- local tempSection = self:Section({Name = ""})
- tempSection:Paragraph(paraConfig)
- end
- return tab
- end
- return Window
- end
- return Library
Advertisement
Add Comment
Please, Sign In to add comment