ok i solved it by doing this in the inner loop

while ( key_x ){
p = 0;
while ( p <= 100 ){ // exit on finish or on key up
p += speed * time_step;
if (key_x){
ent_animate(my, "saludoB", p, ANM_CYCLE);
} else {
ent_animate(my, "saludoB", p, ANM_ADD);
}
wait(1);
}
}