RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"a textButton that moves around with me using arrow keys"
-- LocalScript inside the TextButton local textButton = script.Parent local UserInputService = game:GetService("UserInputService") local speed = 5 local function moveButton(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.Left then textButton.Position = textButton.Position - UDim2.new(0, speed, 0, 0) elseif input.KeyCode == Enum.KeyCode.Right then textButton.Position = textButton.Position + UDim2.new(0, speed, 0, 0) elseif input.KeyCode == Enum.KeyCode.Up then textButton.Position = textButton.Position - UDim2.new(0, 0, 0, speed) elseif input.KeyCode == Enum.KeyCode.Down then textButton.Position = textButton.Position + UDim2.new(0, 0, 0, speed) end end UserInputService.InputBegan:Connect(moveButton)