Leave Button for Mobile
Key RequiredUniversal

Leave Button for Mobile

Universal Scriptmiwoomsmsmsmmiwoomsmsmsm 3.9K views 5.4K executesUpdated May 26, 2025
Unrated
00
Lua Script•48 lines (1508 chars)
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui
screenGui.ResetOnSpawn = false

local button = Instance.new("TextButton")
button.Parent = screenGui
button.Text = "Leave"
button.Size = UDim2.new(0, 100, 0, 50)
button.Position = UDim2.new(0.5, -50, 0.5, -25)
button.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
button.TextColor3 = Color3.fromRGB(255, 255, 255)

local dragging = false
local dragStart = nil
local startPos = nil

button.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = button.Position
    end
end)

button.InputChanged:Connect(function(input)
    if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
        local delta = input.Position - dragStart
        button.Position = UDim2.new(
            startPos.X.Scale,
            startPos.X.Offset + delta.X,
            startPos.Y.Scale,
            startPos.Y.Offset + delta.Y
        )
    end
end)

button.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = false
    end
end)

button.MouseButton1Click:Connect(function()
    game:Shutdown()
end)

Features & Information

- Automatically closes the game on click - Draggable - Works on every game

Community Comments (2)

onlyoneflawonlyoneflawMay 26, 2025

What kind of stupid script is this

miwoomsmsmsmmiwoomsmsmsmJun 26, 2025

@dcaquanti is the name not obvious? omfg

More Scripts for Universal Scripts