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

Why will user input service not function?

Asked by 4 years ago

I am attempting to print something upon any key being pressed with the user input service.

Why does this code not work at all?

local userInputService = game:GetService("UserInputService")

userInputService.InputBegan:Connect (function(input, gameProcessedEvent)

    print("1")

end)

1 answer

Log in to vote
1
Answered by
SpiralRBX 224 Moderation Voter
4 years ago

Simple Fix! You have everything right, but you misplaced the script.

To fix this, simply put the script in

game.StarterPlayer.StarterPlayerScripts and make sure its a local script.

Here is what I mean:

https://prnt.sc/tcva9j

Just like that :)

Ad

Answer this question