How do I detect if a player pressed space using a local script?
COMMUNITY QUESTION
How do I detect if a player pressed space using a local script?
1 answer
Use userinput service
UIS = game:GetService('UserInputService')
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
--code
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I would put the local script under starterGui starterpack or starter player scripts
It doesn't work but doesn't show any errors in the output