Im trying to end animations before the next one players, but it isnt stopping the animation? any help?
function AnimEnder(Humanoid)
local emotenames = nil
for _,anim in pairs(Humanoid.Animator:GetPlayingAnimationTracks()) do
print(anim.Name)
for i, emotenames in pairs(game.ReplicatedStorage:WaitForChild("EmoteNPCs"):WaitForChild("EmoteNPC"):GetChildren()) do
if emotenames:IsA("Animation") then
if anim.Name == emotenames.Name then
print("stopping " .. anim.Name)
anim:Stop()
end
end
end
end
end
No so I ended up changing it around a little bit and got it working, but it only stops one before returning false, how would I make it still stop all the animations before returning?
function EmoteEnder(humanoid)
for _,anim in pairs(humanoid.Animator:GetPlayingAnimationTracks()) do
print(anim.Name)
if anim.Name == "Goner" or anim.Name == "TakeTheL" or anim.Name == "KneelRespect" or anim.Name == "BowRespect" or anim.Name == "PirateRun" or anim.Name == "Worm" or anim.Name == "Bobbin" or anim.Name == "Griddy" then
print("stopping " .. anim.Name)
anim:Stop()
return false
else
return true
end
end
end