So I tried adding controller support to my game but functions will run despite the gui not being shown.
Here's an example one:
(local script)
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end) wait() if game:GetService("UserInputService").GamepadEnabled then script.Parent.Text = "Press (X) to exit" end game:GetService("UserInputService").InputBegan:connect(function(input) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonX then script.Parent.Parent.Visible = false end end end)
Is there a way to have it be activated like mousebutton1click?