Is your code in StarterGui or StarterPlayerScripts? Because the line of code works for me
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
print("test")
end
end)
its working now, but when the code i put goes into a affect it doesn’t show on screen, it’s a startergui that is supposed to go away when you press space, it only changes in properties and not on the actual screen