Exit Game
Key RequiredUniversal

Exit Game

Universal ScriptAdorbsxVibesPr3ppyAdorbsxVibesPr3ppy 54.9K views 1.2K executesUpdated Jul 31, 2024
2.5/ 5(2 votes)
1150% Positive
Lua Script•33 lines (976 chars)
-- Create the ScreenGui

local gui = gethui() -- Gets the hidden UI layer

-- Create the ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = gui

-- Create the exit button
local exitButton = Instance.new("TextButton")
exitButton.Name = "ExitButton"
exitButton.Text = "Exit Game"
exitButton.Size = UDim2.new(0, 100, 0, 50)
exitButton.Position = UDim2.new(1, -110, 0, 10)
exitButton.AnchorPoint = Vector2.new(1, 0)
exitButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
exitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
exitButton.Font = Enum.Font.SourceSansBold
exitButton.TextSize = 18
exitButton.Parent = screenGui

-- Add corner radius to the button
local cornerRadius = Instance.new("UICorner")
cornerRadius.CornerRadius = UDim.new(0, 8)
cornerRadius.Parent = exitButton

-- Function to exit the game
local function exitGame()
    game:Shutdown()
end

-- Connect the button click to the exit function
exitButton.MouseButton1Click:Connect(exitGame)

Features & Information

Idk

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts