Replacing animations via tools/keybind

Hello, I’ve been trying to make a system in which when you equip a weapon, it replaces your current “Animate” script with another, but when I tried that, I could do it back and forth once, until it gave me an error that I wasn’t aware on how to fix. Then I tried to just replace animations manually but then the animations would play at half. What’s the PROPER way of going about replacing animation sets. similar to how in games where you can equip weapons and when you hold said weapon, your idle, walk, run, jump and fall change, and then unequipping yields the opposite. Does anybody know how to do that?

Any and all help would be greatly appriciated. I’m trying to improve however I can as a solo dev.

Animation priority might be what youre looking for