It is in a textbutton, local script. Works in studios but not in game.
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
script.Parent.MouseButton1Click:Connect(function()
local anims = humanoid:GetPlayingAnimationTracks()
for i,v in pairs(anims) do
v:Stop()
end
end)
script.Parent.MouseButton1Click:Connect(function()
local anims = humanoid:GetPlayingAnimationTracks()
for i,v in pairs(anims) do
if v.Name == "Anim" then
v:Stop()
end
end
end)

3 comments
is the script a localscript or normal script
local script
Please post more information besides that it does not work.