> For the complete documentation index, see [llms.txt](/llms.txt)

# Rankings

A global leaderboard with a scheduled entry period and rewards handed out by rank.




**About this demo**

The demo signs in automatically with an anonymous account. The account is shared across every demo in the showroom, so items and currency you get in one demo carry over to the others. Loading takes a moment. If the frame is too small, open the demo in a new tab.

## Overview

A leaderboard shared by every visitor. Start a three-minute contest under **Score contest**, post scores, and once your contest is over, receive coins by the rank you finished at. Each visitor's entry window is opened by a GS2-Schedule trigger, and the scores and rewards are a GS2-Ranking2 global ranking.

## How to try it

1. Press **Start contest** to open your own contest for three minutes; **Status** turns to **Open: play while the time lasts** and **Ends** counts down the time left.
1. Press **Play** to score a random 1 to 1000. Only a new personal best is posted, and **You** shows your rank and best score.
1. The board below lists other visitors' scores with your own row (**You**) among them; other visitors' new scores can take a few minutes to appear.
1. Press **Finish contest** (or wait three minutes) to close the contest; **Status** turns to **Over: your reward is ready to receive**.
1. Press **Receive**; the reward for your rank (1st 300, 2nd-3rd 150, 4th-10th 80, anyone else who played 30 coins) lands in **Free balance** under **Where the coins land**.

The ranking has a single season, so each account can receive a reward once. Open the demo in another browser or a private window to join the same board as a second anonymous account.

## GS2 services used

- [GS2-Ranking2](/microservices/ranking2/): A GS2-Ranking2 global ranking (higher is better, 1 to 1000) puts every visitor's score on one board and pays the reward for each rank band once the contest is over.
- [GS2-Schedule](/microservices/schedule/): A GS2-Schedule relative event is the ranking's entry period; the trigger pulled by **Start contest** opens it for three minutes per visitor.
- [GS2-Exchange](/microservices/exchange/): **Start contest** and **Finish contest** are free GS2-Exchange rates whose transactions pull and clear the trigger.
- [GS2-Money2](/microservices/money2/): The rank reward coins are deposited into the GS2-Money2 wallet as free currency.

## Use it in GS2 Studio

In GS2 Studio's Simple mode, open **Add features** and press **Add** on **Rankings** to bring this feature into your own project. To point at the package directly, choose **Add from GitHub** and enter the package below.

```text
https://github.com/gs2io/gs2-studio-package/tree/main/micro-liveops-ranking/packages/micro-liveops-ranking
```

- Owner: `gs2io`
- Repository: `gs2-studio-package`
- Subdirectory: `micro-liveops-ranking/packages/micro-liveops-ranking`

## Source code

- Demo project: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-liveops-ranking/live-demo>
- Feature package: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-liveops-ranking>



