function PlayerThumbnailUtils.promiseUserThumbnail(R,k,t)assert(type(R)=="\110\117\109\098\101\114","\066\097\100 \117\115\101\114\073\100")k=k or Enum.ThumbnailType.HeadShot t=t or Enum.ThumbnailSize.Size100x100 local u u=Promise.spawn(function(n,L)local W=0 repeat W=W+1 local P,y local b,C=pcall(function()P,y=Players:GetUserThumbnailAsync(R,k,t)end)if not b then return L(C)end if y then return n(P)else task.wait(.05)end until W>=MAX_TRIES or not u:IsPending()L()end)return u end

function PlayerThumbnailUtils.promiseUserThumbnail(userId, thumbnailType, thumbnailSize)
	assert(type(userId) == "number", "Bad userId")
	thumbnailType = thumbnailType or Enum.ThumbnailType.HeadShot
	thumbnailSize = thumbnailSize or Enum.ThumbnailSize.Size100x100

	local promise
	promise = Promise.spawn(function(resolve, reject)
		local tries = 0
		repeat
			tries = tries + 1
			local content, isReady
			local ok, err = pcall(function()
				content, isReady = Players:GetUserThumbnailAsync(userId, thumbnailType, thumbnailSize)
			end)

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

			if isReady then
				return resolve(content)
			else
				task.wait(0.05)
			end
		until tries >= MAX_TRIES or (not promise:IsPending())
		reject()
	end)

	return promise
end
