function PlayerThumbnailUtils.promiseUserName(F)assert(type(F)=="\110\117\109\098\101\114","\066\097\100 \117\115\101\114\073\100")local Q Q=Promise.spawn(function(h,q)local z=0 repeat z=z+1 local o local y,E=pcall(function()o=Players:GetNameFromUserIdAsync(F)end)if not y then return q(E)end if type(o)=="\115\116\114\105\110\103"then return h(o)else task.wait(.05)end until z>=MAX_TRIES or not Q:IsPending()q()end)return Q end return PlayerThumbnailUtils

function PlayerThumbnailUtils.promiseUserName(userId)
	assert(type(userId) == "number", "Bad userId")

	local promise
	promise = Promise.spawn(function(resolve, reject)
		local tries = 0
		repeat
			tries = tries + 1
			local name
			local ok, err = pcall(function()
				name = Players:GetNameFromUserIdAsync(userId)
			end)

			-- Don't retry if we immediately error (timeout exceptions!)
			if not ok then
				return reject(err)
			end

			if type(name) == "string" then
				return resolve(name)
			else
				task.wait(0.05)
			end
		until tries >= MAX_TRIES or (not promise:IsPending())
		reject()
	end)

	return promise
end

return PlayerThumbnailUtils
