if FFlagAnimateScriptEmoteHook then(script:WaitForChild("\080\108\097\121\069\109\111\116\101")).OnInvoke=function(N)if pose~="\083\116\097\110\100\105\110\103"then return end if emoteNames[N]~=nil then playAnimation(N,EMOTE_TRANSITION_TIME,Humanoid)return true elseif typeof(N)=="\073\110\115\116\097\110\099\101"and N:IsA("\065\110\105\109\097\116\105\111\110")then playEmote(N,EMOTE_TRANSITION_TIME,Humanoid)return true end return false end end

if FFlagAnimateScriptEmoteHook then
	script:WaitForChild("PlayEmote").OnInvoke = function(emote)
		-- Only play emotes when idling
		if pose ~= "Standing" then
			return
		end
	
		if emoteNames[emote] ~= nil then
			-- Default emotes
			playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
			
			return true
		elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
			-- Non-default emotes
			playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)
			return true
		end
		
		-- Return false to indicate that the emote could not be played
		return false
	end
end
