[SOLVED] Pressing the A Button does nothing?
Asked by
6 years ago Edited 5 years ago
01 | local label = script.Parent |
02 | local UserInputService = game:GetService( "UserInputService" ) |
03 | local ContextActionService = game:GetService( "ContextActionService" ) |
04 | local GuiService = game:GetService( "GuiService" ) |
06 | label.TextScaled = GuiService:IsTenFootInterface() |
09 | if UserInputService.GamepadEnabled = = true then |
10 | label.Text = "Press A" |
12 | label.Text = "Press Enter" |
17 | local menuFrame = label.Parent:FindFirstChild( "MenuFrame" ) |
19 | if menuFrame ~ = nil then |
20 | ContextActionService:UnbindAction( "StartGame" ) |
21 | menuFrame.Visible = true |
26 | function pressEnter(actionName, inputState, inputObj) |
27 | if inputState = = Enum.UserInputState.Begin then |
32 | ContextActionService:BindAction( "StartGame" , pressEnter, false , Enum.KeyCode.Return, Enum.KeyCode.ButtonA) |
36 | UserInputService.GamepadConnected:Connect( function () |
40 | UserInputService.GamepadDisconnected:Connect( function () |
45 | label.TextTransparency = 0 |
47 | label.TextTransparency = 1 |
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?