Im trying to make an animation end when the player unequips the tool. Heres the script:
function Unequipped()
local IdleAnim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.IdleAnim)
if script.Parent.IdleAnim then script.Parent.IdleAnim:Stop() end
end
I already know the reason, but how do i fix this?
Edit: Here's the edited script
function Unequipped()
local IdleAnim = script.Parent.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.IdleAnim)
IdleAnim:Stop()
end
I have done what DepressionSensei has said, but it still doesnt work. The animation still doesnt stop. Heres the video to demonstrate: https://www.youtube.com/watch?v=h2ZfLWEWG9Q&feature=youtu.be

5 comments
I'm not going to be surprised when i wake up in the morning and find no answers yet.
You posted this at nighttime. Try to post your question at prime time, which is in the middle of the day.
So i should wait until afternoon to post my question?
Use a LocalScript :D
I've been working on this for 2 days, still havent found a solution.