Pages

Pages : Instance

Overview

Properties

IsFinished

bool

IsFinished indicates whether the current page is the last available page.

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
			
        while true do
            local currentPage = worldProducts:GetCurrentPage()	
		    
            -- Exit loop if it's the last page
            if worldProducts.IsFinished or currentPage == nil then         	
                break
            end
        end
    end
end

Methods

GetCurrentPage

Gets the current page and returns it as a Value.

Parameters

Return

Array

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
        
        while true do
            local currentPage = worldProducts:GetCurrentPage()
        
            if currentPage ~= nil then
                for _, productInfo in pairs(currentPage) do	
                    print("World Product Name: " .. tostring(productInfo.Name))  
                end	
            end
        end
    end
end

AdvanceToNextPageAsync

The AdvanceToNextPageAsync method advances to the next page in a paginated data source asynchronously.

Parameters

Return

void

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
			
        while true do
            local currentPage = worldProducts:GetCurrentPage()	
		    
            -- Exit loop if it's the last page
            if worldProducts.IsFinished or currentPage == nil then         	
                break
            else
                worldProducts:AdvanceToNextPageAsync()
            end
        end
    end
end

Events

Last updated