-- Preload animations

function PlayAnimation(AnimName, TransitionTime, Humanoid)
	local IdleFromEmote = (AnimName == "Idle" and EmoteNames[CurrentAnim] ~= nil)
	if AnimName ~= CurrentAnim and not IdleFromEmote then
		
		if CurrentAnimTrack then
			CurrentAnimTrack:Stop(TransitionTime)
			CurrentAnimTrack:Destroy()
		end

		CurrentAnimSpeed = 1
		local Roll = math.random(1, AnimTable[AnimName].TotalWeight) 
		local OrigRoll = roll
		local Index = 1
		while Roll > AnimTable[AnimName][Index].Weight do
			Roll = Roll - AnimTable[AnimName][Index].Weight
			Index = Index + 1
		end