📅  最后修改于: 2022-03-11 14:54:55.058000             🧑  作者: Mango
local UserInputService = game:GetService("UserInputService")
local Key = Enum.KeyCode.WhateverKey
UserInputService.InputBegan:Connect(function(InputObject, GameProcessedEvent)
if GameProcessedEvent then return end
if InputObject.KeyCode = Key then
print("Player pressed "..InputObject.KeyCode)
end
end)