I've shortened the code because this is the only part that matters.
local inputservice = game:GetService("UserInputService")
inputservice.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Insert then
print("sindexmon is the best scripter because he can do print command easter eggs woah")
end
end)
A simple easter egg that has no deprecated features. I thought it was working before, but I must've changed something. I don't really know what else to say besides that this is a server script, and that it's inside a part (in the case that, for whatever reason (kind of outlandish), the script would have trouble communicating with other objects.) Yeah, help.

4 comments
There is an entire wiki page you can look at...
https://developer.roblox.com/en-us/articles/Keyboard-Input-Methods
UserInputService only works in local scripts
the code is correct, just put it in a local script
I followed the wiki page roblox and cmg but it didn't work and even the code samples didn't work