Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ChromeOS = {}
- local function addCorner(instance, radius)
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, radius)
- corner.Parent = instance
- end
- function ChromeOS.Create(titleText, descriptionText)
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 500, 0, 350)
- mainFrame.Position = UDim2.new(0.5, -250, 0.5, -175)
- mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- mainFrame.Parent = screenGui
- addCorner(mainFrame, 5)
- local topBar = Instance.new("Frame")
- topBar.Size = UDim2.new(1, 0, 0, 40)
- topBar.ZIndex = 10
- topBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- topBar.Parent = mainFrame
- addCorner(topBar, 5)
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(0.5, -10, 1, 0)
- title.Position = UDim2.new(0, 10, 0, 0)
- title.ZIndex = 11
- title.Text = titleText
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.BackgroundTransparency = 1
- title.Parent = topBar
- local description = Instance.new("TextLabel")
- description.Size = UDim2.new(0.5, -10, 1, 0)
- description.Position = UDim2.new(0.5, 0, 0, 0)
- description.Text = descriptionText
- description.ZIndex = 11
- description.TextColor3 = Color3.fromRGB(180, 180, 180)
- description.BackgroundTransparency = 1
- description.Parent = topBar
- local minimizeBtn = Instance.new("TextButton")
- minimizeBtn.Size = UDim2.new(0, 25, 0, 25)
- minimizeBtn.Position = UDim2.new(1, -60, 0, 7)
- minimizeBtn.Text = "_"
- minimizeBtn.ZIndex = 11
- minimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- minimizeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- minimizeBtn.Parent = topBar
- addCorner(minimizeBtn, 5)
- local isMinimized = false
- minimizeBtn.MouseButton1Click:Connect(function()
- if isMinimized then
- mainFrame.Size = UDim2.new(0, 500, 0, 350)
- isMinimized = false
- else
- mainFrame.Size = UDim2.new(0, 500, 0, 1)
- isMinimized = true
- end
- end)
- local closeBtn = Instance.new("TextButton")
- closeBtn.Size = UDim2.new(0, 25, 0, 25)
- closeBtn.Position = UDim2.new(1, -30, 0, 7)
- closeBtn.Text = "X"
- closeBtn.ZIndex = 11
- closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- closeBtn.Parent = topBar
- addCorner(closeBtn, 5)
- closeBtn.MouseButton1Click:Connect(function()
- screenGui:Destroy()
- end)
- local tabContainer = Instance.new("ScrollingFrame")
- tabContainer.Size = UDim2.new(1, 0, 0, 40)
- tabContainer.Position = UDim2.new(0, 0, 0, 40)
- tabContainer.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- tabContainer.ScrollBarThickness = 6
- tabContainer.ScrollingDirection = Enum.ScrollingDirection.X -- Desplazamiento horizontal
- tabContainer.ScrollBarVisibility = Enum.ScrollBarVisibility.Always -- Barra de desplazamiento siempre visible
- tabContainer.Parent = mainFrame
- addCorner(tabContainer, 5)
- local contentContainer = Instance.new("ScrollingFrame")
- contentContainer.Size = UDim2.new(1, 0, 1, -80)
- contentContainer.Position = UDim2.new(0, 0, 0, 80)
- contentContainer.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- contentContainer.ScrollBarThickness = 6
- contentContainer.AutomaticCanvasSize = Enum.AutomaticSize.Y
- contentContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- contentContainer.Parent = mainFrame
- addCorner(contentContainer, 10)
- local tabs = {}
- local currentTab = nil
- local currentTabButton = nil
- local window = {}
- function window.SetTitle(newTitle)
- title.Text = newTitle
- end
- function window.SetDescription(newDescription)
- description.Text = newDescription
- end
- function window.AddTab(tabNumber, tabName)
- if tabs[tabNumber] then return end
- local TabButton = Instance.new("TextButton")
- TabButton.Size = UDim2.new(0, 120, 0, 35)
- TabButton.Text = tabName
- TabButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- TabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- TabButton.Parent = tabContainer
- addCorner(TabButton, 5)
- local tabContent = Instance.new("ScrollingFrame")
- tabContent.Size = UDim2.new(1, 0, 1, 0)
- tabContent.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- tabContent.Visible = false
- tabContent.AutomaticCanvasSize = Enum.AutomaticSize.Y
- tabContent.ScrollBarThickness = 6
- tabContent.Parent = contentContainer
- local tabListLayout = Instance.new("UIListLayout")
- tabListLayout.Padding = UDim.new(0, 10)
- tabListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- tabListLayout.Parent = tabContent
- local padding = Instance.new("UIPadding")
- padding.PaddingTop = UDim.new(0, 10)
- padding.Parent = tabContent
- tabs[tabNumber] = tabContent
- TabButton.MouseButton1Click:Connect(function()
- if currentTab then
- currentTab.Visible = false
- currentTabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- end
- tabContent.Visible = true
- currentTab = tabContent
- currentTabButton = TabButton
- TabButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
- end)
- if not currentTab then
- TabButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
- tabContent.Visible = true
- currentTab = tabContent
- currentTabButton = TabButton
- end
- end
- function window.AddButton(tabNumber, buttonText, callback)
- local tabContent = tabs[tabNumber]
- if not tabContent then
- warn("La pestaña " .. tabNumber .. " no existe.")
- return
- end
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(0.8, 0, 0, 40)
- button.Position = UDim2.new(0.1, 0, 0, 0)
- button.AnchorPoint = Vector2.new(0.5, 0)
- button.Position = UDim2.new(0.5, 0, 0, 0)
- button.Text = buttonText
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
- button.Parent = tabContent
- addCorner(button, 5)
- button.MouseButton1Click:Connect(function()
- if callback then
- callback()
- end
- end)
- end
- function window.AddLabel(tabNumber, labelText)
- local tabContent = tabs[tabNumber]
- if not tabContent then
- warn("La pestaña " .. tabNumber .. " no existe.")
- return
- end
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(0.8, 0, 0, 40)
- label.AnchorPoint = Vector2.new(0.5, 0)
- label.Position = UDim2.new(0.5, 0, 0, 0)
- label.Text = labelText
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.BackgroundTransparency = 1
- label.TextXAlignment = Enum.TextXAlignment.Center
- label.Parent = tabContent
- end
- return window
- end
- return ChromeOS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement