Still have questions? Join our Discord server and get real time help.
0

# Roblox - When Using UserInput Nothing Happens? [Solved]

Edited 2 months ago

[Solved by Kiriot22]

Basically I am making a script where when you press enter it will do something. I am using UserInput to do this but for some reason when I press enter it does nothing. I have no errors or warnings in the console. I am using a local script. The code is:

game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Return then
print("Hey! You pressed enter!")
end
end)



Any suggestions? It's in workspace but I think it might need to be somewhere else.

0
use :Connect not :connect tacotown2 119 — 2mo
0
is this a normal or localscript fanofpixels 584 — 2mo
0
LocalScript KingDomas 7 — 2mo
0
Are there any loops above that? Where is this script location? yHasteeD 1547 — 2mo
0
This script works for me? kingdom5 5274 — 2mo
0
Check to see if your script is disabled. upVector 802 — 2mo
0
Not disabled. KingDomas 7 — 2mo

0

Pay attention to capitals, and make sure you are using a local script. :connect should be :Connect if the code is still not working, make sure you have the local script somewhere where it will be run.

game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Return then
print("Hey! You pressed enter!")
end
end)



If this helped please accept the answer so we can both get rep+ :)

0
This does not solve the problem. the problem may be the location or other things. but it is good to remember to use :Connect yHasteeD 1547 — 2mo