Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I edit this gamepad compatibility script?

Asked by 9 years ago
        -- Make character move at normal speed if R1 is released
        if input.KeyCode == Enum.KeyCode.ButtonR1 then
            character.Humanoid.WalkSpeed = 16
        end
    end
end)

-- Check for user input began events. Handles jumping and increasing speed
userInputService.InputBegan:connect(function(input, processed)
    if input.UserInputType == Enum.UserInputType.Gamepad1 then
        -- If A button is pressed then make the character jump
        if input.KeyCode == Enum.KeyCode.ButtonA then
            character.Humanoid.Jump = true
        end
        -- If R1 is pressed then make the character move faster
        if input.KeyCode == Enum.KeyCode.ButtonR1 then
            character.Humanoid.WalkSpeed = 30
        end
    end
end)

Is there any way I can make R1 click instead of running?

0
What do you mean by 'click'? You can call a MouseButton1Down function there, if that's what you mean. adark 5487 — 9y

Answer this question