local uis = game:GetService("UserInputService")
local hasGamepad = uis.GamepadEnabled
if hasGamepad then
else
uis.GamepadConnected:Connect(function(gamepad)
local getGamepad = uis:GetGamepadConnected(gamepad)
if getGamepad then
print("True!")
if gamepad == Enum.UserInputType.Gamepad1 then
print("Gamepad1 !")
end
end
end)
end
In this code, I try getting a player's gamepadEnabled value. If it's true (meaning a gamepad is connected), I wanna get their gamepad and print out "Gamepad1 !" if that gamepad is equal to "Enum.UserInputType.Gamepad1". If gamepadEnabled is false, it waits for a gamepad to connect. If one connects, it runs lines 7-13. How do I get the player's gamepad and its UserInputType if they already have a gamepad connected?
