RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a mobile only text button that will swing a tool"
-- LocalScript inside the TextButton local button = script.Parent local player = game:GetService("Players").LocalPlayer local UserInputService = game:GetService("UserInputService") local function swingTool() if UserInputService.TouchEnabled then local character = player.Character if character then local tool = character:FindFirstChildWhichIsA("Tool") if tool then tool:Activate() end end end end button.MouseButton1Click:Connect(swingTool)