Here is the code I've been working off of. I've gotten the Controller to work, but for reasons unknown to me the function I want to assign to the A button works with every button other than A and left/right on the D-Pad
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent then return end if inputObject.KeyCode == Enum.KeyCode.Space or Enum.KeyCode.ButtonA then --function end end)
You need to tell the script what it needs to compare with Enum.KeyCode.ButtonA
:
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent then return end if inputObject.KeyCode == Enum.KeyCode.Space or inputObject.KeyCode == Enum.KeyCode.ButtonA then (function) end end)