Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I find an animation in a player and disable it?

Asked by 8 years ago

Say the animation is already implemented. So I have a function that when something happens the animation goes away. How would I index the animation to delete it?

2 answers

Log in to vote
1
Answered by 8 years ago

This nifty function is your answer, good sir.

0
But how do I stop tracks from there? I don't understand what it means by " Returns an array of the AnimationTracks currently being played on the Humanoid." An Array? What's that mean Ethan_Waike 156 — 8y
1
An array is essentially a table. BobserLuck 367 — 8y
Ad
Log in to vote
2
Answered by 8 years ago

This MIGHT do it:

--You can use a name or Id to reference the animation you want.
Name="Test"
ID=1111111111 
for i,v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks ()) do
    if v.Animation.Name==Name or v.Animation.AnimationId==ID then
        v:Stop()
    end
end

Answer this question