Someone assisted me in getting this far, but I wanted to know how to get the code working for studios, but not in game, what is stopping it from actually working?
Thanks in advance.
It is a LOCAL SCRIPT.
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)
Thanks guys, with a bit of research that you've sent, I got it.
local player = game.Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("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)