Its pretty basic its mostly from AnimationPlayer
the code is this that i use:
var current_anim = anim_player.get_current_animation()
if current_anim != anim_to_play:
anim_player.play(anim_to_play)
I did try the isactionjust_pressed but that one hardly plays the animation so im still not sure what to do