function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == 13 then print("enter") end end game:GetService("UserInputService").InputBegan:connect(onKeyPress)
The enter key is 13 but this doesn't work so what do I do. I am just trying to print "enter" then the player presses enter.
-- Declaration Section local UserInputService = game:GetService("UserInputService") -- Processing Section local function onPressKey (InputObject, GameProcessedEvent) if InputObject.KeyCode == Enum.KeyCode.Return then print("Enter/Return has been pressed!") end end -- Connecting Section UserInputService.InputBegan:Connect(onPressKey)