The first 3 if statements you’re using are all standalone checks, but your last one has an else after it. That means that after all the first group of checks are done (regardless if they’re true or false) the last one will check for ui_left and if that’s not true, you automatically play the idel animation instead.
Basically, all the code to play animations before your ui_left option gets overwritten because the last statement will be either true (and set left) or false (and set idel).