0% found this document useful (0 votes)
158 views3 pages

Roblox GUI Menu Script Example

The document is a Lua script for creating a graphical user interface (GUI) in a game using Roblox. It includes a main menu with draggable functionality, minimize and close buttons, and an example button, along with credits for the creator. The script also contains logic for minimizing and closing the GUI when the respective buttons are clicked.

Uploaded by

getowo3603
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views3 pages

Roblox GUI Menu Script Example

The document is a Lua script for creating a graphical user interface (GUI) in a game using Roblox. It includes a main menu with draggable functionality, minimize and close buttons, and an example button, along with credits for the creator. The script also contains logic for minimizing and closing the GUI when the respective buttons are clicked.

Uploaded by

getowo3603
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local Players = game:GetService("Players")

local LocalPlayer = [Link]


local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

-- Criar ScreenGui
local ScreenGui = [Link]("ScreenGui")
[Link] = "MenuGUI"
[Link] = false
[Link] = PlayerGui

-- Janela principal
local MainFrame = [Link]("Frame")
[Link] = "MainFrame"
[Link] = [Link](0, 200, 0, 120)
[Link] = [Link](0.5, -100, 0.5, -60)
MainFrame.BackgroundColor3 = [Link](40, 40, 40)
[Link] = 0
[Link] = true
[Link] = true
[Link] = ScreenGui

-- Barra do título
local TitleBar = [Link]("Frame")
[Link] = "TitleBar"
[Link] = [Link](1, 0, 0, 20)
TitleBar.BackgroundColor3 = [Link](30, 30, 30)
[Link] = 0
[Link] = MainFrame

-- Texto do título
local Title = [Link]("TextLabel")
[Link] = "Title"
[Link] = [Link](1, -60, 1, 0)
[Link] = [Link](0, 5, 0, 0)
[Link] = 1
[Link] = "Meu Menu"
Title.TextColor3 = [Link](255, 255, 255)
[Link] = [Link]
[Link] = [Link]
[Link] = 14
[Link] = TitleBar

-- Botão minimizar
local MinimizeButton = [Link]("TextButton")
[Link] = "MinimizeButton"
[Link] = [Link](0, 20, 1, 0)
[Link] = [Link](1, -40, 0, 0)
MinimizeButton.BackgroundColor3 = [Link](200, 200, 50)
[Link] = 0
[Link] = "_"
MinimizeButton.TextColor3 = [Link](255, 255, 255)
[Link] = [Link]
[Link] = 14
[Link] = TitleBar

-- Botão fechar
local CloseButton = [Link]("TextButton")
[Link] = "CloseButton"
[Link] = [Link](0, 20, 1, 0)
[Link] = [Link](1, -20, 0, 0)
CloseButton.BackgroundColor3 = [Link](255, 50, 50)
[Link] = 0
[Link] = "X"
CloseButton.TextColor3 = [Link](255, 255, 255)
[Link] = [Link]
[Link] = 14
[Link] = TitleBar

-- Área de conteúdo
local ContentFrame = [Link]("Frame")
[Link] = "ContentFrame"
[Link] = [Link](1, 0, 1, -20)
[Link] = [Link](0, 0, 0, 20)
[Link] = 1
[Link] = MainFrame

-- Um botão exemplo
local Button = [Link]("TextButton")
[Link] = "ExampleButton"
[Link] = [Link](0.8, 0, 0, 30)
[Link] = [Link](0.1, 0, 0.2, 0)
Button.BackgroundColor3 = [Link](60, 60, 60)
[Link] = 0
[Link] = "Botão"
Button.TextColor3 = [Link](255, 255, 255)
[Link] = [Link]
[Link] = 14
[Link] = ContentFrame

-- Créditos (opcional)
local Credit = [Link]("TextLabel")
[Link] = [Link](0.8, 0, 0, 20)
[Link] = [Link](0.1, 0, 0.6, 0)
[Link] = 1
[Link] = "Criado por você"
Credit.TextColor3 = [Link](200, 200, 200)
[Link] = [Link]
[Link] = 14
[Link] = ContentFrame

-- Lógica do botão fechar


CloseButton.MouseButton1Click:Connect(function()
ScreenGui:Destroy()
end)

-- Lógica do botão minimizar


local Minimized = false
local OriginalSize = [Link]

MinimizeButton.MouseButton1Click:Connect(function()
Minimized = not Minimized

if Minimized then
[Link] = [Link]([Link], [Link], 0,
20)
[Link] = false
else
[Link] = OriginalSize
[Link] = true
end
end)

You might also like