Anyone know how to make a ROBLOX character's walkspeed increase from 16 to about 25 when a button on an Xbox controller is pressed? The button I would like is L3 (or the left thumbstick pressed down) if it's possible? And when the player isn't pressing on it anymore how can I revert it back to walkspeed 16?
Read up on Gamepad Input on the roblox wiki http://wiki.roblox.com/index.php?title=Gamepad_Input
local uis = game:GetService('UserInputService') local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hum = char.Humanoid uis.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonL3 then hum.WalkSpeed = 25 end end end) uis.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonL3 then hum.WalkSpeed = 16 end end end)