function EmoteManager.getOwnedEmotesAsync(a,t,J)local f={}local u=0 local R=0 for t in pairs(paidEmotes)do R=R+1 end for v,G in pairs(paidEmotes)do task.spawn(function()local P,m=pcall(function()return a.MarketplaceService:PlayerOwnsAsset(t,G.emote)end)if P then if m then f[v]=G end else warn("\069\114\114\111\114 \103\101\116\116\105\110\103 \097\115\115\101\116 \111\119\110\101\114\115\104\105\112 \102\111\114",G.emote)end u=u+1 if u==R then J(f)end end)end end

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 then
				if ownsEmote then
					ownedEmotes[emoteName] = emoteInfo
				end
			else
				warn("Error getting asset ownership for", emoteInfo.emote)
			end

			numComplete = numComplete + 1

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