Make your animation and then use the door script as a template.
It has Key capability, auto based on player range.
2 types of initiating animation are already scripted into it.
At the bottom of your fpe file add this and change the frames to match your animation lengths.
;anim
animmax = 2
anim0 = 0,50
anim1 = 51,100
playanimineditor = 0
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.