Iam making a pickup and drop system
I got everything done except the animation part. I just want the animation to play inside one function and stop playing in the other function
The issue is that i can play the animation when one function is fired but can’t stop it when the other function is fired
I’ve search everywhere but can’t seem to find how to fix this issue.
I personally think the fix is that i have to find a way to store the animation data in something then try and take that data with me to the other function. Iam probably wrong but i just wanted to share my theory or whatever.
The Code is in a server script
local function PickUp(player)
local idleanimation = script.IdleAnim
local animator = player.Character.Humanoid:FindFirstChildOfClass("Animator")
local animationTrack = animator:LoadAnimation(idleanimation)
animationTrack:Play()
end
local function DropBox(player)
-- Something here maybe
animationTrack:Stop()
end
Anything helps 
,P0TAT0RED