It would probably be the second one as the first snippet doesnt look for any input from the user. However, there's a few mistakes in the code, mainly that you have a variable called "attck animation", which is an invalid variable name, as there's a space in the name.
Also (although this depends on your animations), your object will play through all the frames it contains when using play object without any extra parameters to say at what frame to start and end, but if you have no other anims this wont matter. Also, you might want add a check if an anim is playing before you play another one, because overlapping animations look really bad. This might be done using:
attack=0
if keystate(34)=1 then attack=1 : attckanimation=1
If attackanimation=1 and object playing(1)=0
play object 1
Endif
Cheers,
Kentaree
I would be unstoppable if I could just get started...