For some reason user input service is not working for me, I just started to learn about this so i know next to nothing about it, but i've watched alot of tutorials, copying there code that makes it so if i press A, the output will say you pressed A. And i even went to the roblox dev hub, and copied the code straight from there, and its still not working, What am i doing wrong?
iv'e never seen the thing that gamer posted so here's what i do:
local uis = game:GetService("UserInputService") -- get the service uis.InputBegan:Connect(funtion(Input) --calls the function when anything is pressed if Input.KeyCode == Enum.KeyCode.A then --check if the keycode is A this is case sensitive in other words make sure your caps are correct print("A was pressed") end end)
make sure its a local script and is in the starterpack after that for userinputservice to work u need the line
if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.key here) then --function here end