function EmoteManager.getOwnedEmotesAsync(G,Q,Y)local L={}local H=0 local j=0 for Q in pairs(paidEmotes)do j=j+1 end for i,s in pairs(paidEmotes)do task.spawn(function()local q,d=pcall(function()return G.MarketplaceService:PlayerOwnsAsset(Q,s.emote)end)if q and d then L[i]=s end H=H+1 if H==j then Y(L)end end)end end
--[[
	Determines which paid emotes the user owns and returns them through the
	provided callback

	Parameters:
	player - the player used to check ownership
	callback - the function to call once all paid emotes have been checked
]]
function EmoteManager:getOwnedEmotesAsync(player, callback)
	local ownedEmotes = {}
	local numComplete = 0
	local numEmotes = 0

	-- Since paidEmotes is a dictionary, we have to loop over it to count the items
	for _ in pairs(paidEmotes) do
		numEmotes = numEmotes + 1
	end

	for emoteName, emoteInfo in pairs(paidEmotes) do
		task.spawn(function()
			local success, ownsEmote = pcall(function()
				return self.MarketplaceService:PlayerOwnsAsset(player, emoteInfo.emote)
			end)

			if success and ownsEmote then
				ownedEmotes[emoteName] = emoteInfo
			end

			numComplete = numComplete + 1

			if numComplete == numEmotes then
				callback(ownedEmotes)
			end
		end)
	end
end
