Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] Pressing the A Button does nothing?

Asked by 6 years ago
Edited 5 years ago
01local label = script.Parent
02local UserInputService = game:GetService("UserInputService")
03local ContextActionService = game:GetService("ContextActionService")
04local GuiService = game:GetService("GuiService")
05 
06label.TextScaled = GuiService:IsTenFootInterface()
07 
08function button()
09    if UserInputService.GamepadEnabled == true then
10        label.Text = "Press A"
11    else
12        label.Text = "Press Enter"
13    end
14end
15 
View all 49 lines...

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?

0
instead of doing Enum.KeyCode.ButtonA try doing Enum.KeyCode.A HappyTimIsHim 652 — 6y
0
Are you using this in Server Script? this works in Local Script. yHasteeD 1819 — 6y
0
OOOOOOOOOOOOF!!!!! you are putting a loop at lines 44 - 49, you do realize once a loop starts it cannot end unless you use break, right? Basically any touch event, anything like that will clearly not work until the loop ends. greatneil80 2647 — 6y
0
Does that affect BindAction too? BrockRocksYourSocks 48 — 6y
View all comments (2 more)
0
@HappyTimIsHim he is using a gamepad not a keyboard. "Enum.KeyCode.A" is for keyboards. DeceptiveCaster 3761 — 6y
0
@greatneil80 i agree. Doing that would trigger an epileptic seizure. DeceptiveCaster 3761 — 6y

Answer this question