Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ummm why doesn't my user input service work?

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

✓ Accepted answer

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

2 comments

0

and what does that exactly mean? "localplayer's directory "

0

By that i meant places like: StarterGui, StarterPlayer->StarterCharacterScripts, StarterPlayer->StarterPlayerScripts

This discussion is preserved as it was. New answers, comments, and votes are closed.