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

ummm why doesn't my user input service work?

Asked by
seikkatsu 110
4 years ago

i have this script

local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input)
    local keyIn = input.KeyCode
    if keyIn == Enum.KeyCode.A then
        print("A was pressed!")
    end
end)

and it's in a local script parented to a part and i don't understand why it doesn't work any help would be apriciated

1 answer

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
4 years ago

If you're using roblox's "UserInputService" it's basically in the name of it "user" you can't really put it somewhere else and want it to still capture, you need to place it into the localplayer's directory or startergui

0
and what does that exactly mean? "localplayer's directory " seikkatsu 110 — 4y
0
By that i meant places like: StarterGui, StarterPlayer->StarterCharacterScripts, StarterPlayer->StarterPlayerScripts VitroxVox 884 — 4y
Ad

Answer this question