ok i am tring to use my animated sword swing to play through once but when the key is pressed it plays constantly so i tried sepreating the key press code from the animation code it helped somewhat but for the life of me i can't figure out a good code to stop the animation when it completes. i don't want the sword to swing again till the key is released and then pressed again.
here is my code
IF pressed = 0
`restarts the sword animation to 1 after space is pressed
IF SPRITE FRAME(16) < 1: SET SPRITE FRAME 16, 1: ENDIF
play sprite 16, 1, 1, 50
endif
elapsed2=(Timer()-t2)
if spacekey()=1 then pressed = 1
if pressed=1 and (move = 3 or move = 5) and attack = 0 and elasped2 < 50
show sprite 16
show sprite 17
hide sprite 14
play sprite 17, 1, 1, 50
`sword animation
play sprite 16, 1, 5, 10
move = 5
t2 = timer()
pressed = 0
elasped2=0
endif]
sorry if it is a bit jumbled i planned to clean it up once it was finished