OMFG!!
ok in the chest object, make a collision with the hero object.
Create Event:
open_chest = false;
ani_speed = "you set this";
Collision Event:
if dir == "u" { if keyboard_check(vk_enter) { open_chest = true; }};
Step Event:
image_speed = ani_speed;
if image_index >= 5 { dialog("You've recieved some Crap"); }
image_index = "last image";
Note: the dialog is not a function it'd be a script, you would have to have your own dialog script inorder for that to work.
Ok hope that helps.