gamecircle.Leaderboard.GetScoresReturn

Type Table
Library gamecircle.*
Revision Release 2024.3703
Keywords leaderboards, return, value, table, scores

Overview

Table that encapulates the error values and return values from the [GetScores][plugin.gamecircle.Leaderboard.GetScores] function.

Properties

Example

local leaderboardId = "myFirstLeaderboard"  
local gamecircle = require("plugin.gamecircle")  
gamecircle.Init(false, true, false)  
function LeaderboardCallback(returnValue)  
    if returnValue.isError == true then  
        print("Get Scores request returned with error message: " .. returnValue.errorMessage)  
    else  
        print("Score information recieved for Leaderboard!")  
        print("-Leaderboard ID" .. returnValue.id)  
        print("-name" .. returnValue.name)  
        print("-displayText" .. returnValue.displayText)  
        print("-num" .. returnValue.num)  
        print("-scoreFormat" .. returnValue.scoreFormat)  
        print("-scores:")  
        for i, score in ipairs(returnValue) do  
            print("--Rank " .. score.rank)  
            print("---" .. score.scoreString .. " by " .. score.player.alias)  
        end  
    end  
end  
gamecircle.Leaderboard.GetScores(leaderboardId, "GLOBAL_WEEK", LeaderboardCallback)