Without any further information, maybe something like this?
Create global variable type Text - AnimationTime
on object destroyed - system set variable AnimationTime to "yes"
on specific key pressed
system compare variable AnimationTime = "yes"
play animation