How would I make an animation when a key is pressed?

Pretty sure there is a “play animation” node. You would just hook up your “input key” to that and you should be good to go.