function EmoteManager.getOwnedEmotesAsync(R,w,l)local O={}local q=0 local e=0 for w in pairs(paidEmotes)do e=e+1 end for C,E in pairs(paidEmotes)do task.spawn(function()local V,a=pcall(function()return R.MarketplaceService:PlayerOwnsAsset(w,E.emote)end)if V and a then O[C]=E end q=q+1 if q==e then l(O)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 and ownsEmote then
				ownedEmotes[emoteName] = emoteInfo
			end

			numComplete = numComplete + 1

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