local UserInputService = game:GetService("UserInputService")
local function onInputBegan(input,gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
local keyPressed = input.KeyCode
script.Parent.Value.Value = input.KeyCode
print("a")
print(input.KeyCode)
end
end
UserInputService.InputBegan:connect(onInputBegan)
and the output is
01:21:01.744 - Players.Kwok6140.PlayerGui.Console.Script:5: bad argument #3 to 'Value' (string expected, got EnumItem)

4 comments
You could try tostring(input.KeyCode), but idk if that'll work.
Ok
Not working but Thank
You can't place a KeyCode value in a string value