local label = script.Parent local UserInputService = game:GetService("UserInputService") local ContextActionService = game:GetService("ContextActionService") local GuiService = game:GetService("GuiService") label.TextScaled = GuiService:IsTenFootInterface() function button() if UserInputService.GamepadEnabled == true then label.Text = "Press A" else label.Text = "Press Enter" end end function startGame() local menuFrame = label.Parent:FindFirstChild("MenuFrame") if menuFrame ~= nil then ContextActionService:UnbindAction("StartGame") menuFrame.Visible = true label:Destroy() end end function pressEnter(actionName, inputState, inputObj) if inputState == Enum.UserInputState.Begin then startGame() end end ContextActionService:BindAction("StartGame", pressEnter, false, Enum.KeyCode.Return, Enum.KeyCode.ButtonA) button() UserInputService.GamepadConnected:Connect(function() button() end) UserInputService.GamepadDisconnected:Connect(function() button() end) while true do label.TextTransparency = 0 wait(0.25) label.TextTransparency = 1 wait(0.25) end
Even though pressEnter() is bound to both the Enter key on a keyboard and the A Button on a gamepad, nothing happens when I press A.
Is there a way to fix this?