Animation doesn't load when wanted

I want my animation to change from crouching to walking, and to walking to crouching right as I click crouch.

As seen in this video here:
robloxapp-20220619-1234398.wmv (1.4 MB)
the animations don’t switch right away when I go from walking to crouching, and back.

Originally it worked PERFECTLY when I used a local script, but I am using a server script because the animation looks goofy when I used a local script and there’s other players.

Here’s the code for when I do go from walking to crouching:
image
I doubt the problem is within this script though.

Player animations are made to be played on the client, so they will always be delayed when played on the server.

As mentioned above, this should be in a local script. We could instead help you resolve

this issue. (If you could showcase it in a video or a screenshot)

It’s suppose to say “server script” in that quote, not local. And I am NOT using a local script because the animation only changes from the players side, not the whole server.