I've noticed a large number of console players playing my game, and some parts of it do not work properly with xbox controls according to my friend who plays on console. My previous attempt worked except for the fact that even if the GUI wasn't active if the button was pressed it would run the function/fire the event.
I'm not asking for an entire script, I am asking for what I would check/what functions I could use, I already know how to implement controls.
Thank you in advance!
EDIT:
Here's the script I tried using:
wait() if game:GetService("UserInputService").GamepadEnabled then script.Parent.Text = "(Y)\n?" end game:GetService("UserInputService").InputBegan:connect(function(input) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonY then if script.Parent.Visible == true then if plr.QuestActive.Value ~= true then local start = true game.ReplicatedStorage.Quests.QuestStart:FireServer(start) end script.Parent.Parent.Visible = false if game.Players.LocalPlayer:IsInGroup(4071812) then plr.Character.Humanoid.WalkSpeed = 20 else plr.Character.Humanoid.WalkSpeed = 16 end end end end end)