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

How to script Xbox Controller Functions?

Asked by 7 years ago
Edited 7 years ago

What is wrong with the following:

script.Parent.preGame.Unlocks.InputBegan:connect(function(input, processed)
    if input.UserInputType == Enum.UserInputType.Gamepad1 then
        if input.KeyCode == Enum.KeyCode.ButtonA then
            script.Parent.preGame.Unlocks.Selectable = false
            script.Parent.preGame.startcover.Selectable = false
            script.Parent.Unlocks.Appearance.Selectable = true
            script.Parent.Unlocks.Back.Selectable = true
            script.Parent.Unlocks.Blasters.Selectable = true
            script.Parent.Unlocks.StarCards.Selectable = true
        end
    end
end)

I want something to happen when a certain "button" is pressed by the "A" button on a Xbox Controller.

0
Look in the wiki for ContextActionService. GoldenPhysics 474 — 7y
0
Are you trying to do this from the player? If so If I'm not mistaken you need to use game:GetService("UserInputService") MrLonely1221 701 — 7y

Answer this question