local uis = game:GetService("UserInputService") uis.InputBegan:Connect(function(input) local key = input.KeyCode if key == Enum.KeyCode.F then print("hmm") end end)
soo here is my script. it's parented to the workspace and it's a local script and i can't see where the error is. could i please get some help?
Here's the script.
My apologies for not explaining, in a rush.
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then print("R was pressed") end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.R) -- The above line could also been written as: -- game.ContextActionService:BindAction("keyPress", onKeyPress, false, "r")