Unable to stop animations from a local script?

I was having a lot of trouble with my animations when I was trying to enable and disable custom animations for my tool. The animations were working fine and every time I wanted to use either my idle or walking animation I would disable the default player animation script and enable it again once the tool was unequipped.

I would stop all the animations when I enabled the default script again so that nothing overlapped but for some reason the animations from the Roblox animations script would stack after I did that and I would be running while standing still. All I did to fix this was move my for loop that stops all the animations to a server script and fired it with a remote event and suddenly that fixed it. What I want to know is why did the for loop not work in a local script. Playing animations in the local worked fine but stopping them doesn’t work? Can someone explain why this is?