Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
{
"date": "2026-04-02",
"summary": "Improved multiplayer docs: added Quick Join section, documented player username/ping/last-joined/last-left expressions, lobby ID expression, custom message variable variant, and synchronization rate action"
},
{
"date": "2026-04-14",
"summary": "Improved leaderboards docs: documented CloseLeaderboardView action, HasPlayerJustClosedLeaderboardView condition, LastSaveError expression with error-code table, SetPreferSendConnectedPlayerScore action, and client-side rate limiting details"
}
]
}
31 changes: 30 additions & 1 deletion docs/gdevelop5/all-features/leaderboards/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,35 @@ Use the action **"Save connected player score"** (or **"Save player score"** if

## Check that the score was correctly saved

You have 3 conditions at your disposal to monitor how the saving is run through.
You have 3 conditions at your disposal to monitor how the saving is run through:

- **Score is saving** — true while the save request is in flight.
- **Last score save has succeeded** — true once the save completes successfully.
- **Last score save has errored** — true if the save failed.

![](/gdevelop5/all-features/leaderboards/pasted/20220412-143408.png)

For each of those conditions, you can specify the leaderboard but this is optional. This can prove useful if you try to save the player score in multiple leaderboards at once.

### Get the error code from a failed save

When a save fails, the **`Leaderboards::LastSaveError`** string expression returns an error code you can use to give feedback to the player or debug the issue. Common error codes include:

| Error code | Meaning |
|---|---|
| `SAME_AS_PREVIOUS` | The same player and score were already submitted — duplicate ignored |
| `TOO_FAST` | The save was attempted within 500 ms of the previous attempt — wait a bit |
| `LEADERBOARD_RATE_LIMIT_EXCEEDED` | More than 6 successful entries were submitted to the same leaderboard within 1 minute |
| `GLOBAL_RATE_LIMIT_EXCEEDED` | More than 12 successful entries were submitted across all leaderboards within 1 minute |

!!! tip

Rate limits apply client-side to prevent abuse. A typical game flow (one save per level completion) will never hit them. They become relevant only if your events could accidentally trigger the action every frame or in a tight loop.

### Control whether connected-player scores take priority

By default, when a player is logged in, the **"Save player score"** action automatically attaches the score to that player (ignoring the player-name parameter). Use the action **"Always attach scores to the connected player"** to turn this automatic upgrade on or off.

## Display a leaderboard

Use the action "**Display leaderboard**" to load and display a leaderboard on the screen. It will be displayed on top of your game, and the view will have a button to close it in order to come back to your game.
Expand All @@ -54,6 +77,12 @@ While it's **loading**, to let the player know that the leaderboard will display

Either case, if there's an error during the display, *it will close automatically*. You can also use the 2 conditions "Leaderboard display has errored" and "Leaderboard display has loaded" if you want to add logic around a possible error.

## Close the leaderboard programmatically

The leaderboard view has a built-in close button that the player can use at any time. You can also close it yourself with the **"Close current leaderboard"** action — for example, after a time limit or when the player presses a specific key.

To detect that the player has closed the view by clicking the built-in close button, use the **"Closed by player"** condition. It is true for exactly one frame after the view closes. This is a good time to resume gameplay, play a sound, or change the scene.

## Advanced: pause the scene when the leaderboard is displayed

We recommend that you send back the player to a menu scene or a non gameplay scene after you open the leaderboard.
Expand Down