I understand the use of the _G variable but it doesn't work because this animation is in a function. Are there any way I can solve it? Here is some code.
_G.KillAnim = plrs.Character:WaitForChild("Humanoid"):LoadAnimation(script.KillDragging)
_G.SurvAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.Dragging2)
_G.KillAnim:Play()
_G.SurvAnim:Play()
The thing with that is, it wouldn't let me get the variable from a different script because it was inside of a scope, any ideas on how I could solve it?

1 comment
Well wouldn't I have to go into another scope just to retrieve that data? Well I guess I could send the needed stuff to every script that would have to stop the animation right? But how would I stop said animation from a different script without accessing the variable I used to play the animation?