I have a text button that shows the name of the emote in a frame with others and I have a script that makes you able to press on it then you player does the emote. This works but, when I make a looping animation there is no way to stop it. When you click it you do the animation and can't stop even when another is clicked. It looks really weird and people can't stop so I need a script that can make it stop when another emote is clicked or just a stop text button whichever works. Thank you.
The script I use in the text button:
wait(3) Player = game.Players.LocalPlayer.Character animation1 = Player.Humanoid:LoadAnimation(script.Animation1) CanEmote = true
script.Parent.MouseButton1Click:connect(function() local emote = math.random(1,1) if emote == 1 and CanEmote == true then animation1:Play() CanEmote=false wait(2) CanEmote=true end end)
Anything I can do or add?

2 comments
Thanks but, do I put it n the same local script or a different one. The text button has a local script inside and animation1 in the local script. Should I add something?
Replace the script with that