I've tried stopping an animation, but it just doesn't work. It keeps on saying "Stop is not a valid member of Animation.", and I use ":Stop" for a variable, yet it still doesn't work. Here's the code:
script.Parent.Parent.Unequipped:connect(function() local anim = script.Parent.Animation anim:Stop() end)
Please help.
Well, the way you're doing it is incorrect. To play an Animation, you load it to the humanoid. So, since this is another script, I recommend making the anim
variable in the animation playing script global _G.anim
. That way, you can access it in this script and put _G.anim:Stop()
.