Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local CoreGui = game:GetService("CoreGui")
- local RunService = game:GetService("RunService")
- local function Create(className, properties)
- local instance = Instance.new(className)
- for k, v in pairs(properties) do
- if k ~= "Parent" then
- instance[k] = v
- end
- end
- if properties.Parent then
- instance.Parent = properties.Parent
- end
- return instance
- end
- local function MakeDraggable(topbarObject, object)
- local dragging = false
- local dragInput = nil
- local dragStart = nil
- local startPos = nil
- local function update(input)
- local delta = input.Position - dragStart
- local targetPos = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- TweenService:Create(object, TweenInfo.new(0.15, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = targetPos}):Play()
- end
- topbarObject.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = object.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- topbarObject.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- end
- local Library = {}
- function Library:Create(config)
- local titleText = config.Title or "Library"
- local subTitleText = config.SubTitle or "Version"
- local useLoader = config.Loader or false
- local targetParent = (gethui and gethui()) or CoreGui
- local existing = targetParent:FindFirstChild("StellarUI")
- if existing then existing:Destroy() end
- local gui = Create("ScreenGui", {
- Name = "StellarUI",
- Parent = targetParent,
- ResetOnSpawn = false,
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- })
- local MainFrame = Create("Frame", {
- Name = "MainFrame",
- Parent = gui,
- Size = UDim2.new(0, 650, 0, 420),
- Position = UDim2.new(0.5, -325, 0.5, -210),
- BackgroundColor3 = Color3.fromRGB(15, 15, 15),
- BorderSizePixel = 0,
- Visible = not useLoader,
- ClipsDescendants = true
- })
- Create("UICorner", {Parent = MainFrame, CornerRadius = UDim.new(0, 6)})
- local Sidebar = Create("Frame", {
- Name = "Sidebar",
- Parent = MainFrame,
- Size = UDim2.new(0, 160, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = Color3.fromRGB(11, 11, 12),
- BorderSizePixel = 0
- })
- local TitleArea = Create("Frame", {
- Name = "TitleArea",
- Parent = Sidebar,
- Size = UDim2.new(1, 0, 0, 60),
- BackgroundTransparency = 1
- })
- MakeDraggable(TitleArea, MainFrame)
- Create("TextLabel", {
- Parent = TitleArea,
- Size = UDim2.new(1, -20, 0, 20),
- Position = UDim2.new(0, 15, 0, 15),
- BackgroundTransparency = 1,
- Text = titleText,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- Font = Enum.Font.GothamBold,
- TextSize = 14,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- Create("TextLabel", {
- Parent = TitleArea,
- Size = UDim2.new(1, -20, 0, 15),
- Position = UDim2.new(0, 15, 0, 35),
- BackgroundTransparency = 1,
- Text = subTitleText,
- TextColor3 = Color3.fromRGB(150, 150, 150),
- Font = Enum.Font.Gotham,
- TextSize = 11,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- local TabContainer = Create("ScrollingFrame", {
- Name = "TabContainer",
- Parent = Sidebar,
- Size = UDim2.new(1, 0, 1, -120),
- Position = UDim2.new(0, 0, 0, 60),
- BackgroundTransparency = 1,
- ScrollBarThickness = 0,
- CanvasSize = UDim2.new(0, 0, 0, 0)
- })
- local TabListLayout = Create("UIListLayout", {
- Parent = TabContainer,
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 5),
- HorizontalAlignment = Enum.HorizontalAlignment.Center
- })
- local ContentContainer = Create("Frame", {
- Name = "ContentContainer",
- Parent = MainFrame,
- Size = UDim2.new(1, -170, 1, -20),
- Position = UDim2.new(0, 165, 0, 10),
- BackgroundTransparency = 1
- })
- local LoaderObj = {}
- if useLoader then
- local LoaderFrame = Create("Frame", {
- Parent = gui,
- Size = UDim2.new(0, 650, 0, 420),
- Position = UDim2.new(0.5, -325, 0.5, -210),
- BackgroundTransparency = 1,
- Visible = false,
- ClipsDescendants = true
- })
- local LeftHalf = Create("Frame", {
- Parent = LoaderFrame,
- Size = UDim2.new(0.5, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundColor3 = Color3.fromRGB(15, 15, 15),
- BorderSizePixel = 0
- })
- local RightHalf = Create("Frame", {
- Parent = LoaderFrame,
- Size = UDim2.new(0.5, 0, 1, 0),
- Position = UDim2.new(0.5, 0, 0, 0),
- BackgroundColor3 = Color3.fromRGB(15, 15, 15),
- BorderSizePixel = 0
- })
- local LoadText = Create("TextLabel", {
- Parent = LoaderFrame,
- Size = UDim2.new(1, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundTransparency = 1,
- Text = "Loading...",
- TextColor3 = Color3.fromRGB(255, 255, 255),
- TextSize = 22,
- Font = Enum.Font.GothamBold,
- ZIndex = 10
- })
- function LoaderObj:Start()
- LoaderFrame.Visible = true
- MainFrame.Visible = false
- end
- function LoaderObj:SetText(txt)
- LoadText.Text = txt
- end
- function LoaderObj:End()
- local tInfo = TweenInfo.new(0.7, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut)
- TweenService:Create(LoadText, TweenInfo.new(0.3), {TextTransparency = 1}):Play()
- task.wait(0.3)
- TweenService:Create(LeftHalf, tInfo, {Position = UDim2.new(-0.5, 0, 0, 0)}):Play()
- TweenService:Create(RightHalf, tInfo, {Position = UDim2.new(1, 0, 0, 0)}):Play()
- task.wait(0.7)
- LoaderFrame:Destroy()
- MainFrame.Visible = true
- MainFrame.Size = UDim2.new(0, 550, 0, 320)
- MainFrame.Position = UDim2.new(0.5, -275, 0.5, -160)
- MainFrame.BackgroundTransparency = 1
- for _, v in pairs(MainFrame:GetDescendants()) do
- if v:IsA("Frame") or v:IsA("TextLabel") or v:IsA("ScrollingFrame") then
- if v.BackgroundTransparency < 1 then
- local orig = v.BackgroundTransparency
- v.BackgroundTransparency = 1
- TweenService:Create(v, TweenInfo.new(0.5), {BackgroundTransparency = orig}):Play()
- end
- if v:IsA("TextLabel") then
- local origTxt = v.TextTransparency
- v.TextTransparency = 1
- TweenService:Create(v, TweenInfo.new(0.5), {TextTransparency = origTxt}):Play()
- end
- end
- end
- TweenService:Create(MainFrame, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
- Size = UDim2.new(0, 650, 0, 420),
- Position = UDim2.new(0.5, -325, 0.5, -210),
- BackgroundTransparency = 0
- }):Play()
- end
- end
- local firstTab = true
- local activeTabBtn = nil
- local Window = {}
- Window.Loader = LoaderObj
- function Window:Tab(tabName)
- local TabBtn = Create("TextButton", {
- Parent = TabContainer,
- Size = UDim2.new(0.9, 0, 0, 32),
- BackgroundColor3 = Color3.fromRGB(166, 243, 230),
- BackgroundTransparency = firstTab and 0 or 1,
- Text = " " .. tabName,
- TextColor3 = firstTab and Color3.fromRGB(0, 0, 0) or Color3.fromRGB(150, 150, 150),
- Font = Enum.Font.GothamSemibold,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left,
- AutoButtonColor = false
- })
- Create("UICorner", {Parent = TabBtn, CornerRadius = UDim.new(0, 6)})
- local Indicator = Create("Frame", {
- Parent = TabBtn,
- Size = UDim2.new(0, 2, 0.6, 0),
- Position = UDim2.new(1, -4, 0.2, 0),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0,
- Visible = firstTab
- })
- Create("UICorner", {Parent = Indicator, CornerRadius = UDim.new(1, 0)})
- local Page = Create("ScrollingFrame", {
- Parent = ContentContainer,
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- ScrollBarThickness = 2,
- ScrollBarImageColor3 = Color3.fromRGB(40, 40, 40),
- Visible = firstTab,
- CanvasSize = UDim2.new(0, 0, 0, 0)
- })
- local PageLayout = Create("UIListLayout", {
- Parent = Page,
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 8)
- })
- PageLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- Page.CanvasSize = UDim2.new(0, 0, 0, PageLayout.AbsoluteContentSize.Y + 10)
- end)
- if firstTab then
- activeTabBtn = TabBtn
- firstTab = false
- end
- TabBtn.MouseButton1Click:Connect(function()
- if activeTabBtn == TabBtn then return end
- TweenService:Create(activeTabBtn, TweenInfo.new(0.2), {BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(150, 150, 150)}):Play()
- activeTabBtn:FindFirstChildOfClass("Frame").Visible = false
- TweenService:Create(TabBtn, TweenInfo.new(0.2), {BackgroundTransparency = 0, TextColor3 = Color3.fromRGB(0, 0, 0)}):Play()
- TabBtn:FindFirstChildOfClass("Frame").Visible = true
- activeTabBtn = TabBtn
- for _, child in pairs(ContentContainer:GetChildren()) do
- if child:IsA("ScrollingFrame") then
- child.Visible = false
- end
- end
- Page.Visible = true
- end)
- local TabElements = {}
- function TabElements:Section(sectionName)
- local SectionFrame = Create("Frame", {
- Parent = Page,
- Size = UDim2.new(1, -10, 0, 25),
- BackgroundTransparency = 1
- })
- Create("TextLabel", {
- Parent = SectionFrame,
- Size = UDim2.new(1, 0, 0, 15),
- BackgroundTransparency = 1,
- Text = sectionName,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- Font = Enum.Font.GothamSemibold,
- TextSize = 13,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- Create("Frame", {
- Parent = SectionFrame,
- Size = UDim2.new(1, 0, 0, 1),
- Position = UDim2.new(0, 0, 1, 0),
- BackgroundColor3 = Color3.fromRGB(40, 40, 40),
- BorderSizePixel = 0
- })
- local SectionObj = {}
- SectionObj.ParentObj = Page
- function SectionObj:Toggle(options)
- local tName = options.Name or "Toggle"
- local state = options.Default or false
- local callback = options.Callback or function() end
- local ToggleFrame = Create("Frame", {
- Parent = SectionObj.ParentObj,
- Size = UDim2.new(1, -10, 0, 35),
- BackgroundColor3 = Color3.fromRGB(18, 18, 19),
- BorderSizePixel = 0
- })
- Create("UICorner", {Parent = ToggleFrame, CornerRadius = UDim.new(0, 6)})
- Create("TextLabel", {
- Parent = ToggleFrame,
- Size = UDim2.new(1, -60, 1, 0),
- Position = UDim2.new(0, 10, 0, 0),
- BackgroundTransparency = 1,
- Text = tName,
- TextColor3 = Color3.fromRGB(200, 200, 200),
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- local ToggleBtn = Create("TextButton", {
- Parent = ToggleFrame,
- Size = UDim2.new(0, 36, 0, 18),
- Position = UDim2.new(1, -46, 0.5, -9),
- BackgroundColor3 = state and Color3.fromRGB(166, 243, 230) or Color3.fromRGB(40, 40, 40),
- Text = "",
- AutoButtonColor = false
- })
- Create("UICorner", {Parent = ToggleBtn, CornerRadius = UDim.new(1, 0)})
- local Indicator = Create("Frame", {
- Parent = ToggleBtn,
- Size = UDim2.new(0, 14, 0, 14),
- Position = state and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0
- })
- Create("UICorner", {Parent = Indicator, CornerRadius = UDim.new(1, 0)})
- ToggleBtn.MouseButton1Click:Connect(function()
- state = not state
- TweenService:Create(ToggleBtn, TweenInfo.new(0.2), {BackgroundColor3 = state and Color3.fromRGB(166, 243, 230) or Color3.fromRGB(40, 40, 40)}):Play()
- TweenService:Create(Indicator, TweenInfo.new(0.2), {Position = state and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)}):Play()
- callback(state)
- end)
- end
- function SectionObj:Slider(options)
- local sName = options.Name or "Slider"
- local min = options.Min or 0
- local max = options.Max or 100
- local def = options.Default or min
- local callback = options.Callback or function() end
- local SliderFrame = Create("Frame", {
- Parent = SectionObj.ParentObj,
- Size = UDim2.new(1, -10, 0, 50),
- BackgroundColor3 = Color3.fromRGB(18, 18, 19),
- BorderSizePixel = 0
- })
- Create("UICorner", {Parent = SliderFrame, CornerRadius = UDim.new(0, 6)})
- Create("TextLabel", {
- Parent = SliderFrame,
- Size = UDim2.new(1, -20, 0, 25),
- Position = UDim2.new(0, 10, 0, 0),
- BackgroundTransparency = 1,
- Text = sName,
- TextColor3 = Color3.fromRGB(200, 200, 200),
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- local ValueText = Create("TextLabel", {
- Parent = SliderFrame,
- Size = UDim2.new(0, 40, 0, 25),
- Position = UDim2.new(1, -50, 0, 0),
- BackgroundTransparency = 1,
- Text = tostring(def),
- TextColor3 = Color3.fromRGB(150, 150, 150),
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Right
- })
- local SliderBg = Create("TextButton", {
- Parent = SliderFrame,
- Size = UDim2.new(1, -20, 0, 6),
- Position = UDim2.new(0, 10, 0, 30),
- BackgroundColor3 = Color3.fromRGB(30, 30, 30),
- Text = "",
- AutoButtonColor = false
- })
- Create("UICorner", {Parent = SliderBg, CornerRadius = UDim.new(1, 0)})
- local Fill = Create("Frame", {
- Parent = SliderBg,
- Size = UDim2.new((def - min) / (max - min), 0, 1, 0),
- BackgroundColor3 = Color3.fromRGB(166, 243, 230),
- BorderSizePixel = 0
- })
- Create("UICorner", {Parent = Fill, CornerRadius = UDim.new(1, 0)})
- local Knob = Create("Frame", {
- Parent = Fill,
- Size = UDim2.new(0, 12, 0, 12),
- Position = UDim2.new(1, -6, 0.5, -6),
- BackgroundColor3 = Color3.fromRGB(255, 255, 255),
- BorderSizePixel = 0
- })
- Create("UICorner", {Parent = Knob, CornerRadius = UDim.new(1, 0)})
- local dragging = false
- local function updateSlider(input)
- local percent = math.clamp((input.Position.X - SliderBg.AbsolutePosition.X) / SliderBg.AbsoluteSize.X, 0, 1)
- local val = math.floor(min + (max - min) * percent)
- TweenService:Create(Fill, TweenInfo.new(0.1), {Size = UDim2.new(percent, 0, 1, 0)}):Play()
- ValueText.Text = tostring(val)
- callback(val)
- end
- SliderBg.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- updateSlider(input)
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- updateSlider(input)
- end
- end)
- end
- function SectionObj:Dropdown(options)
- local dName = options.Name or "Dropdown"
- local list = options.Options or {}
- local callback = options.Callback or function() end
- local isOpen = false
- local DropFrame = Create("Frame", {
- Parent = SectionObj.ParentObj,
- Size = UDim2.new(1, -10, 0, 35),
- BackgroundColor3 = Color3.fromRGB(18, 18, 19),
- BorderSizePixel = 0,
- ClipsDescendants = true
- })
- Create("UICorner", {Parent = DropFrame, CornerRadius = UDim.new(0, 6)})
- local DropBtn = Create("TextButton", {
- Parent = DropFrame,
- Size = UDim2.new(1, 0, 0, 35),
- BackgroundTransparency = 1,
- Text = "",
- AutoButtonColor = false
- })
- Create("TextLabel", {
- Parent = DropBtn,
- Size = UDim2.new(1, -20, 1, 0),
- Position = UDim2.new(0, 10, 0, 0),
- BackgroundTransparency = 1,
- Text = dName,
- TextColor3 = Color3.fromRGB(200, 200, 200),
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left
- })
- local SelectedText = Create("TextLabel", {
- Parent = DropBtn,
- Size = UDim2.new(0, 100, 1, 0),
- Position = UDim2.new(1, -130, 0, 0),
- BackgroundTransparency = 1,
- Text = list[1] or "None",
- TextColor3 = Color3.fromRGB(150, 150, 150),
- Font = Enum.Font.Gotham,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Right
- })
- local DropList = Create("ScrollingFrame", {
- Parent = DropFrame,
- Size = UDim2.new(1, -20, 0, 0),
- Position = UDim2.new(0, 10, 0, 40),
- BackgroundTransparency = 1,
- ScrollBarThickness = 0,
- CanvasSize = UDim2.new(0, 0, 0, 0)
- })
- local DropLayout = Create("UIListLayout", {
- Parent = DropList,
- SortOrder = Enum.SortOrder.LayoutOrder,
- Padding = UDim.new(0, 5)
- })
- local function refreshOptions()
- for _, v in pairs(DropList:GetChildren()) do
- if v:IsA("TextButton") then v:Destroy() end
- end
- local ySize = 0
- for _, opt in pairs(list) do
- local oBtn = Create("TextButton", {
- Parent = DropList,
- Size = UDim2.new(1, 0, 0, 25),
- BackgroundColor3 = Color3.fromRGB(25, 25, 25),
- Text = opt,
- TextColor3 = Color3.fromRGB(200, 200, 200),
- Font = Enum.Font.Gotham,
- TextSize = 11,
- AutoButtonColor = false
- })
- Create("UICorner", {Parent = oBtn, CornerRadius = UDim.new(0, 4)})
- ySize = ySize + 30
- oBtn.MouseButton1Click:Connect(function()
- SelectedText.Text = opt
- isOpen = false
- TweenService:Create(DropFrame, TweenInfo.new(0.2), {Size = UDim2.new(1, -10, 0, 35)}):Play()
- callback(opt)
- end)
- end
- DropList.Size = UDim2.new(1, -20, 0, math.clamp(ySize, 0, 100))
- DropList.CanvasSize = UDim2.new(0, 0, 0, ySize)
- return ySize
- end
- DropBtn.MouseButton1Click:Connect(function()
- isOpen = not isOpen
- local listSize = refreshOptions()
- local targetHeight = isOpen and (45 + math.clamp(listSize, 0, 100)) or 35
- TweenService:Create(DropFrame, TweenInfo.new(0.2), {Size = UDim2.new(1, -10, 0, targetHeight)}):Play()
- end)
- end
- return SectionObj
- end
- return TabElements
- end
- return Window
- end
- return Library
Advertisement
Add Comment
Please, Sign In to add comment