
KeylessUniversal

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "TouchOptimizedGUI"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui
-- ==================== DRAGGABLE FUNCTION (Mobile-Friendly) ====================
local function makeDraggable(frame, handle)
handle = handle or frame
local dragging = false
local dragInput, dragStart, startPos
local function updateInput(input)
if dragging then
local delta = input.Position - dragStart
frame.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
end
handle.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
handle.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
updateInput(input)
end
end)
end
-- ==================== TOGGLE BUTTON (Bigger + Glow for Mobile) ====================
local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(0, 80, 0, 80) -- Bigger for fingers
toggleButton.Position = UDim2.new(0, 15, 0.5, -40)
toggleButton.BackgroundColor3 = Color3.fromRGB(0, 120, 255)
toggleButton.Text = "☰"
toggleButton.TextColor3 = Color3.new(1, 1, 1)
toggleButton.TextSize = 50
toggleButton.Font = Enum.Font.GothamBlack
toggleButton.BorderSizePixel = 0
toggleButton.Parent = screenGui
local corner1 = Instance.new("UICorner")
corner1.CornerRadius = UDim.new(0, 20)
corner1.Parent = toggleButton
-- Subtle glow/shadow so it's visible on any background
local shadow = Instance.new("ImageLabel")
shadow.Size = UDim2.new(1, 10, 1, 10)
shadow.Position = UDim2.new(0, -5, 0, -5)
shadow.BackgroundTransparency = 1
shadow.Image = "rbxassetid://241650635" -- Soft black glow
shadow.ImageColor3 = Color3.new(0, 0, 0)
shadow.ImageTransparency = 0.6
shadow.ZIndex = toggleButton.ZIndex - 1
shadow.Parent = toggleButton
makeDraggable(toggleButton)
-- ==================== MAIN FRAME ====================
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 420, 0, 620) -- Slightly taller for mobile
mainFrame.Position = UDim2.new(0.5, -210, 0.5, -310)
mainFrame.BackgroundColor3 = Color3.fromRGB(32, 32, 32)
mainFrame.BorderSizePixel = 0
mainFrame.Visible = false
mainFrame.Parent = screenGui
local mainCorner = Instance.new("UICorner")
mainCorner.CornerRadius = UDim.new(0, 16)
mainCorner.Parent = mainFrame
-- Title Bar (taller for easier dragging on mobile)
local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 70) -- Taller
titleBar.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
titleBar.BorderSizePixel = 0
titleBar.Parent = mainFrame
local titleCorner = Instance.new("UICorner")
titleCorner.CornerRadius = UDim.new(0, 16)
titleCorner.Parent = titleBar
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -140, 1, 0)
titleLabel.Position = UDim2.new(0, 25, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "My GUI"
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.TextSize = 28
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = titleBar
-- Close Button (bigger hitbox)
local closeButton = Instance.new("TextButton")
closeButton.Size = UDim2.new(0, 70, 0, 70)
closeButton.Position = UDim2.new(1, -70, 0, 0)
closeButton.BackgroundTransparency = 1
closeButton.Text = "✕"
closeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
closeButton.TextSize = 40
closeButton.Font = Enum.Font.GothamBold
closeButton.Parent = titleBar
-- ==================== CONTENT AREA ====================
local content = Instance.new("ScrollingFrame")
content.Size = UDim2.new(1, -30, 1, -90)
content.Position = UDim2.new(0, 15, 0, 80)
content.BackgroundTransparency = 1
content.BorderSizePixel = 0
content.ScrollBarThickness = 10 -- Thicker scrollbar for fingers
content.ScrollingDirection = Enum.ScrollingDirection.Y
content.CanvasSize = UDim2.new(0, 0, 0, 0)
content.Parent = mainFrame
local listLayout = Instance.new("UIListLayout")
listLayout.Padding = UDim.new(0, 15)
listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
listLayout.SortOrder = Enum.SortOrder.LayoutOrder
listLayout.Parent = content
-- Auto-resize canvas
listLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
content.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y + 30)
end)
-- Make main frame draggable only by title bar
makeDraggable(mainFrame, titleBar)
-- Toggle & Close
toggleButton.MouseButton1Click:Connect(function()
mainFrame.Visible = not mainFrame.Visible
end)
closeButton.MouseButton1Click:Connect(function()
mainFrame.Visible = false
end)No comments yet for this script.



