[Gamepad] Pressing 2 or More Buttons

I’m having issues with a Gamepad script.

How do I implement a Function which allows users to press 2 buttons or more on Gamepads?
Below is a Spaghetti code I tried to make, which doesn’t work.

Here is my issue,

Another option used was “IsKeyDown” but that didn’t work.

local service = game:GetService("UserInputService")

service.InputBegan:Connect(function(input, gameProcessedEvent)
	if (input.KeyCode == Enum.KeyCode.ButtonL1 and service:IsGamepadButtonDown(Enum.KeyCode.ButtonR1)) then
		print("it Works")
	end
end)

Any Improvements or help to my issue is greatly accepted.

As listed on the DevHub page for IsGamepadButtonDown your first argument needs to be the Gamepad.

This code should rectify your issue.

service:IsGamepadButtonDown(Enum.UserInputType.Gamepad1,Enum.KeyCode.ButtonR1)
2 Likes