local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService") local Player = Players.LocalPlayer if not UserInputService.TouchEnabled then warn("[ThumbstickFix] Touchscreen not detected") return end local PlayerGui = Player:WaitForChild("PlayerGui") -- Remove previous UI local oldGui = PlayerGui:FindFirstChild("ThumbstickRecoveryUI") if oldGui then oldGui:Destroy() end -- Recovery UI local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "ThumbstickRecoveryUI" ScreenGui.ResetOnSpawn = false ScreenGui.DisplayOrder = 10000 ScreenGui.Parent = PlayerGui local Button = Instance.new("TextButton") Button.Name = "RecoverButton" Button.Size = UDim2.fromOffset(120, 34) Button.Position = UDim2.new(1, -132, 0, 85) Button.BackgroundColor3 = Color3.fromRGB(30, 30, 30) Button.TextColor3 = Color3.new(1, 1, 1) Button.Text = "FIX STICK" Button.TextSize = 14 Button.Font = Enum.Font.GothamBold Button.AutoButtonColor = true Button.Parent = ScreenGui local Corner = Instance.new("UICorner") Corner.CornerRadius = UDim.new(0, 10) Corner.Parent = Button -- Draggable button (added) local dragging = false local dragInput local dragStart local startPos Button.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = Button.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) Button.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseMovement then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if dragging and input == dragInput 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) -- State local Recovering = false local LastRecovery = 0 -- Wait for finger release local function WaitForTouchRelease() local deadline = os.clock() + 1.5 repeat local ok, touches = pcall(function() return UserInputService:GetTouches() end) if not ok or #touches == 0 then task.wait(0.1) return end task.wait(0.05) until os.clock() >= deadline end -- Main recovery function local function RecoverThumbstick() if Recovering then return end if os.clock() - LastRecovery < 1.2 then return end Recovering = true LastRecovery = os.clock() Button.Text = "RESETTING..." Button.Active = false WaitForTouchRelease() local success, err = pcall(function() GuiService.TouchControlsEnabled = false task.wait(0.2) GuiService.TouchControlsEnabled = true end) task.wait(0.3) if success then Button.Text = "STICK READY" print("[ThumbstickFix] Recovery completed") else Button.Text = "FIX FAILED" warn("[ThumbstickFix]", err) end Button.Active = true Recovering = false task.delay(1.5, function() if Button.Parent then Button.Text = "FIX STICK" end end) end -- Automatic recovery after Roblox menu closes GuiService.MenuClosed:Connect(function() task.delay(0.3, function() if ScreenGui.Parent then RecoverThumbstick() end end) end) -- Manual emergency recovery Button.Activated:Connect(function() RecoverThumbstick() end) print("[ThumbstickFix] Mobile recovery loaded!")