-- Script de UI pronto para executor -- Funciona direto no jogo local Players = game:GetService("Players") local Player = Players.LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") -- ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "MinhaUI" screenGui.ResetOnSpawn = false -- garante que fique após respawn screenGui.Parent = PlayerGui -- Janela principal local main = Instance.new("Frame") main.Name = "MainFrame" main.Size = UDim2.new(0, 480, 0, 320) main.AnchorPoint = Vector2.new(0.5, 0.5) main.Position = UDim2.new(0.5, 0, 0.5, 0) -- centralizada na tela main.BackgroundColor3 = Color3.fromRGB(30,30,30) main.Parent = screenGui local UICorner = Instance.new("UICorner") UICorner.Parent = main UICorner.CornerRadius = UDim.new(0,8) -- Barra de título local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1,0,0,36) titleBar.BackgroundColor3 = Color3.fromRGB(24,24,24) titleBar.Parent = main local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1,-40,1,0) titleLabel.Position = UDim2.new(0,12,0,0) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "Minha UI" titleLabel.TextColor3 = Color3.new(1,1,1) titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 18 titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.Parent = titleBar -- Botão de fechar X local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.new(0,28,0,28) closeBtn.Position = UDim2.new(1,-36,0,4) closeBtn.Text = "X" closeBtn.BackgroundColor3 = Color3.fromRGB(200,50,50) closeBtn.TextColor3 = Color3.new(1,1,1) closeBtn.Font = Enum.Font.GothamBold closeBtn.TextSize = 18 closeBtn.Parent = titleBar closeBtn.MouseButton1Click:Connect(function() screenGui:Destroy() end) -- Coluna de abas local tabCol = Instance.new("Frame") tabCol.Size = UDim2.new(0,120,1,-36) tabCol.Position = UDim2.new(0,0,0,36) tabCol.BackgroundColor3 = Color3.fromRGB(35,35,35) tabCol.Parent = main local tabLayout = Instance.new("UIListLayout") tabLayout.Padding = UDim.new(0,6) tabLayout.SortOrder = Enum.SortOrder.LayoutOrder tabLayout.Parent = tabCol -- Área de conteúdo local content = Instance.new("Frame") content.Size = UDim2.new(1, -120, 1, -36) content.Position = UDim2.new(0,120,0,36) content.BackgroundColor3 = Color3.fromRGB(40,40,40) content.Parent = main local contentLayout = Instance.new("UIListLayout") contentLayout.Padding = UDim.new(0,6) contentLayout.SortOrder = Enum.SortOrder.LayoutOrder contentLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center contentLayout.Parent = content -- Drag da janela local dragging, dragStart, startPos = false, nil, nil titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = main.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) titleBar.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local delta = input.Position - dragStart main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) -- Função para criar abas local tabs = {} local function CreateTab(tabName) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, -12, 0, 34) btn.Position = UDim2.new(0,6,0,0) btn.BackgroundColor3 = Color3.fromRGB(45,45,45) btn.Text = tabName btn.TextColor3 = Color3.new(1,1,1) btn.Font = Enum.Font.Gotham btn.TextSize = 14 btn.Parent = tabCol local page = Instance.new("ScrollingFrame") page.Size = UDim2.new(1, -16, 1, -16) page.Position = UDim2.new(0,8,0,8) page.BackgroundTransparency = 1 page.Visible = false page.ScrollBarThickness = 6 page.Parent = content local list = Instance.new("UIListLayout", page) list.Padding = UDim.new(0,8) list.SortOrder = Enum.SortOrder.LayoutOrder list:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() page.CanvasSize = UDim2.new(0,0,0,list.AbsoluteContentSize.Y + 8) end) local tabObj = {Button = btn, Page = page} btn.MouseButton1Click:Connect(function() for _,t in ipairs(tabs) do t.Page.Visible = false t.Button.BackgroundColor3 = Color3.fromRGB(45,45,45) end page.Visible = true btn.BackgroundColor3 = Color3.fromRGB(70,70,70) end) function tabObj:AddButton(text, callback) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -12, 0, 36) b.BackgroundColor3 = Color3.fromRGB(65,65,65) b.Text = text or "Button" b.TextColor3 = Color3.new(1,1,1) b.Font = Enum.Font.GothamSemibold b.TextSize = 15 b.Parent = page b.MouseButton1Click:Connect(function() if callback then local ok,err = pcall(callback) if not ok then warn("Button callback error:",err) end end end) return b end function tabObj:AddToggle(text, default, callback) local container = Instance.new("Frame") container.Size = UDim2.new(1, -12, 0, 36) container.BackgroundTransparency = 1 container.Parent = page local label = Instance.new("TextLabel") label.Size = UDim2.new(0.72, 0, 1, 0) label.BackgroundTransparency = 1 label.Text = text or "Toggle" label.TextColor3 = Color3.new(1,1,1) label.Font = Enum.Font.Gotham label.TextSize = 15 label.TextXAlignment = Enum.TextXAlignment.Left label.Parent = container local toggleBtn = Instance.new("TextButton") toggleBtn.Size = UDim2.new(0.28, -6, 1, 0) toggleBtn.Position = UDim2.new(0.72, 6, 0, 0) toggleBtn.BackgroundColor3 = default and Color3.fromRGB(30,170,60) or Color3.fromRGB(120,120,120) toggleBtn.Text = default and "ON" or "OFF" toggleBtn.TextColor3 = Color3.new(1,1,1) toggleBtn.Font = Enum.Font.GothamBold toggleBtn.TextSize = 13 toggleBtn.Parent = container local state = default and true or false toggleBtn.MouseButton1Click:Connect(function() state = not state toggleBtn.Text = state and "ON" or "OFF" toggleBtn.BackgroundColor3 = state and Color3.fromRGB(30,170,60) or Color3.fromRGB(120,120,120) if callback then local ok,err = pcall(callback, state) if not ok then warn("Toggle callback error:",err) end end end) return {Frame = container, Get = function() return state end, Set = function(v) state = not not v toggleBtn.Text = state and "ON" or "OFF" toggleBtn.BackgroundColor3 = state and Color3.fromRGB(30,170,60) or Color3.fromRGB(120,120,120) end} end table.insert(tabs, tabObj) if #tabs == 1 then btn.BackgroundColor3 = Color3.fromRGB(70,70,70) page.Visible = true end return tabObj end -- Criando abas de exemplo local tab1 = CreateTab("Principal") local tab2 = CreateTab("Extras") -- Elementos de exemplo tab1:AddButton("Clique aqui", function() print("Botão pressionado!") end) tab1:AddToggle("Modo Exemplo", false, function(v) print("Toggle agora:",v) end) tab2:AddButton("Outro botão", function() print("Extra!") end)