This is a re post of a post I recently made but didn't include the script in.

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.

Here's the script:

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)

Thank you in advance! I guess

2 comments

0

I suggest you take this down since you have already made a post on this and there is no need to repost your previous post will get read when people come round to it. if you changed anything in the repost just edit the post that you made before. Thanks :)

0

I didn't even know you could edit posts lol