I have this script in a GUI button, causing the player to do an animation, or stop animating.

local human = script.Parent.Parent.Parent.Parent.Parent.Character:WaitForChild("Humanoid")
local animlocation = human.Parent.Emotes.PumpItUp
local anim = human:LoadAnimation(animlocation)
local emotes = human.Parent.Emotes:GetChildren()
local emoting = false

script.Parent.MouseButton1Down:Connect(function()
	local playinganims = human:GetPlayingAnimationTracks()
	for i = 1, #playinganims do
		local track = playinganims[i]
		if track.Animation == animlocation then
			anim:Stop()
		else
			for i = 1, #playinganims do
				local track2 = playinganims[i]
				track2:Stop()
				anim:Play()
			end
		end
	end
end)

For some reason, if the animation plays and it gets stopped by itself, or another animation button, it will refuse to play again until the character moves. Why is this?