Universal Script 📌
4.1k Views
10.4k Executions

Leave Button for Mobile

10K executions
Universal Script 📌
miwoomsmsmsm
miwoomsmsmsm10K executions
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

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

View Raw
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)


Comments

2
Log in to join the conversation. Login
miwoomsmsmsm's profile picture
miwoomsmsmsmUploader1 year ago

@dcaquanti is the name not obvious? omfg

1
onlyoneflaw's profile picture
onlyoneflaw1 year ago

What kind of stupid script is this

1

More universal scripts

See all
Universal Script 📌
1
0
Approved 37 seconds ago
Key System
Universal Script 📌
12
0
Approved 11 minutes ago
Universal Script 📌
12
1
Approved 16 minutes ago
Script hub
80
1
Approved 1 hour ago
Universal Script 📌
555
701
Bumped 2 hours ago
Script hub
1.6M
2.1M
Bumped 9 hours ago
Key System

Script hub

#12 this week

Verified script badgeSnowy Hub 500+ Games & 25600+ Features

Script hub
269.4k
121.2k
Bumped 10 hours ago
Key System
Script hub
171.5k
1.4M
Bumped 13 hours ago
Key System