
Key Required VerifiedUniversal

local gui = gethui and gethui() or game:GetService("CoreGui")
-- 1. Tạo ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "MyPremiumMenu"
screenGui.ResetOnSpawn = false
screenGui.Parent = gui
-- 2. Khung chính (Main Frame)
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 300, 0, 180)
mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Parent = screenGui
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 15)
corner.Parent = mainFrame
-- 3. Nút Thu Nhỏ (Minimize) - Đặt ở góc trên bên phải của MainFrame
local minimizeBtn = Instance.new("TextButton")
minimizeBtn.Name = "MinimizeBtn"
minimizeBtn.Size = UDim2.new(0, 30, 0, 30)
minimizeBtn.Position = UDim2.new(1, -35, 0, 5)
minimizeBtn.BackgroundTransparency = 1
minimizeBtn.Text = "_"
minimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
minimizeBtn.Font = Enum.Font.GothamBold
minimizeBtn.TextSize = 20
minimizeBtn.Parent = mainFrame
-- 4. Nút Phóng To (Open Button) - Hiện lên khi menu bị thu nhỏ
local openBtn = Instance.new("TextButton")
openBtn.Name = "OpenBtn"
openBtn.Size = UDim2.new(0, 50, 0, 50)
openBtn.Position = UDim2.new(0, 20, 0.5, 0) -- Nằm bên cạnh trái màn hình
openBtn.AnchorPoint = Vector2.new(0, 0.5)
openBtn.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
openBtn.Text = "OPEN"
openBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
openBtn.Font = Enum.Font.GothamBold
openBtn.TextSize = 12
openBtn.Visible = false -- Mặc định ẩn
openBtn.Parent = screenGui
local openCorner = Instance.new("UICorner")
openCorner.CornerRadius = UDim.new(1, 0)
openCorner.Parent = openBtn
-- 5. Nút Thoát Game (Giữ nguyên của bạn)
local exitBtn = Instance.new("TextButton")
exitBtn.Name = "FastExit"
exitBtn.Size = UDim2.new(0, 200, 0, 50)
exitBtn.Position = UDim2.new(0.5, 0, 0.6, 0)
exitBtn.AnchorPoint = Vector2.new(0.5, 0.5)
exitBtn.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
exitBtn.Text = "THOÁT GAME NGAY"
exitBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
exitBtn.Font = Enum.Font.GothamBold
exitBtn.TextSize = 16
exitBtn.Parent = mainFrame
local btnCorner = Instance.new("UICorner")
btnCorner.CornerRadius = UDim.new(0, 10)
btnCorner.Parent = exitBtn
-- 6. Tiêu đề (Giữ nguyên của bạn)
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 40)
title.BackgroundTransparency = 1
title.Text = "Bảng Điều Khiển"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.Font = Enum.Font.GothamBold
title.TextSize = 18
title.Parent = mainFrame
--- LOGIC CHỨC NĂNG ---
-- Thu nhỏ và Phóng to
minimizeBtn.MouseButton1Click:Connect(function()
mainFrame.Visible = false
openBtn.Visible = true
end)
openBtn.MouseButton1Click:Connect(function()
mainFrame.Visible = true
openBtn.Visible = false
end)
-- Thoát Game (Giữ nguyên logic của bạn)
exitBtn.MouseEnter:Connect(function()
exitBtn.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
end)
exitBtn.MouseLeave:Connect(function()
exitBtn.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
end)
exitBtn.MouseButton1Click:Connect(function()
exitBtn.Text = "Đang thoát..."
task.wait(0.2)
pcall(function()
game:Shutdown()
end)
game.Players.LocalPlayer:Kick("Bạn đã thoát game.")
end)
-- Kéo thả (Draggable - Giữ nguyên của bạn)
local UserInputService = game:GetService("UserInputService")
local dragging, dragInput, dragStart, startPos
mainFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true dragStart = input.Position startPos = mainFrame.Position
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
mainFrame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end)



Who would use ts