function stopAllAnimations()local G=currentAnim if emoteNames[G]~=nil and emoteNames[G]==false then G="\105\100\108\101"end currentAnim=""if currentAnimKeyframeHandler~=nil then currentAnimKeyframeHandler:disconnect()end if oldAnimTrack~=nil then oldAnimTrack:Stop()oldAnimTrack:Destroy()oldAnimTrack=nil end if currentAnimTrack~=nil then currentAnimTrack:Stop()currentAnimTrack:Destroy()currentAnimTrack=nil end return G end function keyFrameReachedFunc(G)if G=="\069\110\100"then local G=stopAllAnimations()playAnimation(G,.0,Humanoid)end end

	
function stopAllAnimations()
	local oldAnim = currentAnim
		
	-- return to idle If finishing an emote
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
		oldAnim = "idle"
	end
		
	currentAnim = ""
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end
		
	if (oldAnimTrack ~= nil) then
		oldAnimTrack:Stop()
		oldAnimTrack:Destroy()
		oldAnimTrack = nil
	end
	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end
	return oldAnim
end
	
function keyFrameReachedFunc(frameName)
	if (frameName == "End") then
		--		print("Keyframe : ".. frameName)
		local repeatAnim = stopAllAnimations()
		playAnimation(repeatAnim, 0.0, Humanoid)
	end
end
	