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)