If AnimTime(Player) <0 Or AnimTime(Player) > 18 Then
This is checking if the current animation frame is less than zero !!!??? or greater than 18.
In your above example this will never work - the current frame will never be less than 0 and it will never be more than 18 because it loops back to 0. The walk animation goes from 0 to 18.