For future posts, try wrapping your code in PHP tags so it doesn't get so stretched and unreadable.
Anyhoo, it might be that player.ani isn't V5 friendly. I've always used TServerPlayer.setani(str, str) which should work fine in these instances
e.g.
PHP Code:
player.setani("walk","");