--This will run the function onKeyPress when the x key is pressed:
function onKeyPress(actionName, userInputState, inputObject)
--put the code you need here
end
game:GetService("ContextActionService"):BindAction("keyPress", onKeyPress, false, Enum.KeyCode.X) |