CREATE YOUR WORLD
Social

Leaderboard

19min

Setting up a leaderboard

The leaderboard is a module that provides functions for saving and managing each player's rankings and high scores.



STEP 1 : Create a Leaderboard

To create a leaderboard, select the [Get LeaderboardInfo] button in ProjectSettings → Zepeto → ZepetoLeaderboard menu.

Document image




Select [Add Leaderboard] to add a new leaderboard.

If there is a leaderboard that already exists, the leaderboard will appear on the settings screen.

Document image




STEP 2 : Customize a Leaderboard

The pop up window shown below will appear when the [Add Leaderboard] button is selected. You will be able to adjust each parameter values.

Document image


Parameter

Description

Name

Leaderboard name

Update Rule

Score update rules

Max score

Record the user's highest score

Min score

Record user's lowest score

Accumulate score

Add user's scores and save as a record

ResetInfo(s)

You can set a period for the scores to reset. - This is helpful if the leaderboard needs to be updated every season. - The scores will not be reset by default, but you can make adjustments by setting reset periods (monthly, weekly, daily).

STEP 3 : Set score reset

Document image




Score reset rules are as follows:

Period

Description

None

Scores will not reset

Day

Scores will reset daily at the set time (ex. daily ranking)

Week

Scores will reset weekly on the set date and time (ex: weekly ranking)

Month

Scores will reset monthly on the set date and time (ex: monthly ranking; the max Day value is 31, but if the month does not have 31 days, it will automatically adjust to the last day of the month)



STEP 4 : Leaderboard ID

To use ZEPETOScript and leaderboard, you must have the Leaderboard ID information.

To access the Leaderboard information, you can go to Settings (under Edit in the Project Settings menu, go to Zepeto → Zepeto Leaderboard → Edit), or load from ZEPETOScript api.

📘 Please refer to the following guide. [Searching Leaderboard Details]

Document image

Document image

  • Once the reset rule is set, the leaderboard cannot be modified.
  • To change the Reset Rule, you must create a new leaderboard.
  • Reset time is based on UTC+0. Offset will be provided so that the time zone can be changed in the future.



Recording Score

LeaderboardAPI.SetScore() is an API that records the user's score on the leaderboard. Leaderboard ID, Score value, the point of completion and the point of error are passed as an argument.

User information for the score will automatically be saed.

The following is an example for loading the LeaderboardAPI.SetScore function.

TypeScript




The following is the code template for retrieving the user's score to the leaderboard.

TypeScript

Document image


Searching Ranking Details

Get ranking information in a specific range

Use the LeaderboardAPI.GetRangeRank() function to load a specific range of ranking details.

The Boolean value to retrieve leaderboard ID, start ranking, last ranking, reset rule and last season's ranking information, and the callback function from the time of completion and time of error occurrence is passed as an argument.

User information that inquires ranking information is automatically entered, and up to 100 ranking information can be processed per inquiry (ex: paging in 1100, 101200 format for implementation)

❗️ Caution If more than 100 data are loaded at a time, it may not work properly due to API load issues and rate-limits.



Example function call

An example of calling LeaderboardAPI.GetRangeRank() function is as follows:

TypeScript


The following code is an example for loading a specific range of ranking information. You can use the Member value from OnResult to load the profile photo.



📘 Please refer to the following guide. [User Information]

TypeScript

Document image




Searching Leaderboard Details

Search All Leaderboards

Use the LeaderboardAPI.GetAllLeaderboards function to load all leaderboard information in the specified World. The callback function from the time of completion to the time of error occurrence is passed as an argument.

An example of loading LeaderboardAPI.GetAllLeaderboards function is as follows:

TypeScript




The following is an example for loading the entire leaderboard information.

TypeScript

Document image




Search Specific Leaderboards

Use the LeaderboardAPI.GetLeaderboardsfunction to load specific leaderboard information. The callback function for the leaderboard ID, the time of completion, the time of error occurrence are passed as an argument.

An example of loading LeaderboardAPI.GetLeaderboard function is as follows:

TypeScript




The following is an example for loading certain leaderboard inofrmation.

TypeScript

Document image




Leaderboard Usage Example

  • The following is an example of a leaderboard applied to the official ZEPETO World Slime Party.
  • By setting, reading, and utilizing API calls to fetch rankings within a specific range, you can structure it as follows in the UI.
Document image