if you want to stop it you can just use :Stop() on the track :
local Controller = friend.Humanoid
local newAnimation = Instance.new("Animation", friend)
newAnimation.AnimationId = "rbxassetid://10713966026"
local track = Controller:LoadAnimation(newAnimation) --create a variable for your track
track:Play()
task.wait(1) --btw you should use task.wait() bc wait() is deprecated
track:Stop()
it’s the same thing, exept that Humanoid:LoadAnimation() is deprecated and for some reason they changed it to Humanoid.Animator:LoadAnimation() both are working but Humanoid:LoadAnimation() shouldn’t be used for new work
There is one little thing I noticed about the Animator.
If the Animator is created from the server, when the Character is loaded, animations will replicate when played.
If for some reason the Animator is created on the client, Animations played will not replicate.