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

How do I detect if a player pressed space using a local script? [closed]

Asked by 6 years ago

How do I detect if a player pressed space using a local script?

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago

Use userinput service

UIS = game:GetService('UserInputService')

UIS.InputBegan:connect(function(input)
    if input.KeyCode == Enum.KeyCode.Space then
        --code
    end
end)

0
I would put the local script under starterGui starterpack or starter player scripts NYDynamics 71 — 6y
0
It doesn't work but doesn't show any errors in the output FirezoneGamez 155 — 6y
Ad