Advertisement
Jsjdbot

Untitled

Feb 5th, 2025 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.27 KB | None | 0 0
  1. local ChromeOS = {}
  2.  
  3. local function addCorner(instance, radius)
  4. local corner = Instance.new("UICorner")
  5. corner.CornerRadius = UDim.new(0, radius)
  6. corner.Parent = instance
  7. end
  8.  
  9. function ChromeOS.Create(titleText, descriptionText)
  10. local screenGui = Instance.new("ScreenGui")
  11. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12.  
  13. local mainFrame = Instance.new("Frame")
  14. mainFrame.Size = UDim2.new(0, 500, 0, 350)
  15. mainFrame.Position = UDim2.new(0.5, -250, 0.5, -175)
  16. mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  17. mainFrame.Parent = screenGui
  18. addCorner(mainFrame, 5)
  19.  
  20. local topBar = Instance.new("Frame")
  21. topBar.Size = UDim2.new(1, 0, 0, 40)
  22. topBar.ZIndex = 10
  23. topBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  24. topBar.Parent = mainFrame
  25. addCorner(topBar, 5)
  26.  
  27. local title = Instance.new("TextLabel")
  28. title.Size = UDim2.new(0.5, -10, 1, 0)
  29. title.Position = UDim2.new(0, 10, 0, 0)
  30. title.ZIndex = 11
  31. title.Text = titleText
  32. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. title.BackgroundTransparency = 1
  34. title.Parent = topBar
  35.  
  36. local description = Instance.new("TextLabel")
  37. description.Size = UDim2.new(0.5, -10, 1, 0)
  38. description.Position = UDim2.new(0.5, 0, 0, 0)
  39. description.Text = descriptionText
  40. description.ZIndex = 11
  41. description.TextColor3 = Color3.fromRGB(180, 180, 180)
  42. description.BackgroundTransparency = 1
  43. description.Parent = topBar
  44.  
  45. local minimizeBtn = Instance.new("TextButton")
  46. minimizeBtn.Size = UDim2.new(0, 25, 0, 25)
  47. minimizeBtn.Position = UDim2.new(1, -60, 0, 7)
  48. minimizeBtn.Text = "_"
  49. minimizeBtn.ZIndex = 11
  50. minimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  51. minimizeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  52. minimizeBtn.Parent = topBar
  53. addCorner(minimizeBtn, 5)
  54.  
  55. local isMinimized = false
  56.  
  57. minimizeBtn.MouseButton1Click:Connect(function()
  58. if isMinimized then
  59. mainFrame.Size = UDim2.new(0, 500, 0, 350)
  60. isMinimized = false
  61. else
  62. mainFrame.Size = UDim2.new(0, 500, 0, 1)
  63. isMinimized = true
  64. end
  65. end)
  66.  
  67. local closeBtn = Instance.new("TextButton")
  68. closeBtn.Size = UDim2.new(0, 25, 0, 25)
  69. closeBtn.Position = UDim2.new(1, -30, 0, 7)
  70. closeBtn.Text = "X"
  71. closeBtn.ZIndex = 11
  72. closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  73. closeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  74. closeBtn.Parent = topBar
  75. addCorner(closeBtn, 5)
  76. closeBtn.MouseButton1Click:Connect(function()
  77. screenGui:Destroy()
  78. end)
  79.  
  80. local tabContainer = Instance.new("ScrollingFrame")
  81. tabContainer.Size = UDim2.new(1, 0, 0, 40)
  82. tabContainer.Position = UDim2.new(0, 0, 0, 40)
  83. tabContainer.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  84. tabContainer.ScrollBarThickness = 6
  85. tabContainer.ScrollingDirection = Enum.ScrollingDirection.X -- Desplazamiento horizontal
  86. tabContainer.ScrollBarVisibility = Enum.ScrollBarVisibility.Always -- Barra de desplazamiento siempre visible
  87. tabContainer.Parent = mainFrame
  88. addCorner(tabContainer, 5)
  89.  
  90. local contentContainer = Instance.new("ScrollingFrame")
  91. contentContainer.Size = UDim2.new(1, 0, 1, -80)
  92. contentContainer.Position = UDim2.new(0, 0, 0, 80)
  93. contentContainer.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  94. contentContainer.ScrollBarThickness = 6
  95. contentContainer.AutomaticCanvasSize = Enum.AutomaticSize.Y
  96. contentContainer.ScrollingDirection = Enum.ScrollingDirection.Y
  97. contentContainer.Parent = mainFrame
  98. addCorner(contentContainer, 10)
  99.  
  100. local tabs = {}
  101. local currentTab = nil
  102. local currentTabButton = nil
  103.  
  104. local window = {}
  105.  
  106. function window.SetTitle(newTitle)
  107. title.Text = newTitle
  108. end
  109.  
  110. function window.SetDescription(newDescription)
  111. description.Text = newDescription
  112. end
  113.  
  114. function window.AddTab(tabNumber, tabName)
  115. if tabs[tabNumber] then return end
  116.  
  117. local TabButton = Instance.new("TextButton")
  118. TabButton.Size = UDim2.new(0, 120, 0, 35)
  119. TabButton.Text = tabName
  120. TabButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  121. TabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  122. TabButton.Parent = tabContainer
  123. addCorner(TabButton, 5)
  124.  
  125. local tabContent = Instance.new("ScrollingFrame")
  126. tabContent.Size = UDim2.new(1, 0, 1, 0)
  127. tabContent.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  128. tabContent.Visible = false
  129. tabContent.AutomaticCanvasSize = Enum.AutomaticSize.Y
  130. tabContent.ScrollBarThickness = 6
  131. tabContent.Parent = contentContainer
  132.  
  133. local tabListLayout = Instance.new("UIListLayout")
  134. tabListLayout.Padding = UDim.new(0, 10)
  135. tabListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  136. tabListLayout.Parent = tabContent
  137.  
  138. local padding = Instance.new("UIPadding")
  139. padding.PaddingTop = UDim.new(0, 10)
  140. padding.Parent = tabContent
  141.  
  142. tabs[tabNumber] = tabContent
  143.  
  144. TabButton.MouseButton1Click:Connect(function()
  145. if currentTab then
  146. currentTab.Visible = false
  147. currentTabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  148. end
  149. tabContent.Visible = true
  150. currentTab = tabContent
  151. currentTabButton = TabButton
  152. TabButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  153. end)
  154.  
  155. if not currentTab then
  156. TabButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  157. tabContent.Visible = true
  158. currentTab = tabContent
  159. currentTabButton = TabButton
  160. end
  161. end
  162.  
  163. function window.AddButton(tabNumber, buttonText, callback)
  164. local tabContent = tabs[tabNumber]
  165. if not tabContent then
  166. warn("La pestaña " .. tabNumber .. " no existe.")
  167. return
  168. end
  169.  
  170. local button = Instance.new("TextButton")
  171. button.Size = UDim2.new(0.8, 0, 0, 40)
  172. button.Position = UDim2.new(0.1, 0, 0, 0)
  173. button.AnchorPoint = Vector2.new(0.5, 0)
  174. button.Position = UDim2.new(0.5, 0, 0, 0)
  175. button.Text = buttonText
  176. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  177. button.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  178. button.Parent = tabContent
  179. addCorner(button, 5)
  180.  
  181. button.MouseButton1Click:Connect(function()
  182. if callback then
  183. callback()
  184. end
  185. end)
  186. end
  187.  
  188. function window.AddLabel(tabNumber, labelText)
  189. local tabContent = tabs[tabNumber]
  190. if not tabContent then
  191. warn("La pestaña " .. tabNumber .. " no existe.")
  192. return
  193. end
  194.  
  195. local label = Instance.new("TextLabel")
  196. label.Size = UDim2.new(0.8, 0, 0, 40)
  197. label.AnchorPoint = Vector2.new(0.5, 0)
  198. label.Position = UDim2.new(0.5, 0, 0, 0)
  199. label.Text = labelText
  200. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  201. label.BackgroundTransparency = 1
  202. label.TextXAlignment = Enum.TextXAlignment.Center
  203. label.Parent = tabContent
  204. end
  205.  
  206. return window
  207. end
  208.  
  209. return ChromeOS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement