# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse
# Local doc: epic-docs/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse.md
# Section: player\_leaderboards.verse
# This file contains the code that updates the billboards, player references, and UI on the island
# to display a player's stats from their player stats table. It also handles adding wins and points to a
# player's stats table.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation}
# The message to display on the stats billboard.
StatsMessage<localizes>(CurrentPlayer:message, Points:message, Wins:message):message=
"{CurrentPlayer}:\n{Points}\n{Wins}"
PlayerText<localizes>(CurrentPlayer:agent):message = "Player {CurrentPlayer}"
PointsText<localizes>(Points:int):message = "Total Points {Points}"
WinsText<localizes>(Wins:int):message = "{Wins} Total Wins"
# Updates the given billboard device to display the stats of the given player.
UpdateStatsBillboard<public>(Player:agent, StatsBillboard:billboard_device):void=
if:
CurrentPlayerStats := GetPlayerStats[Player]
then:
PlayerStatsText := StatsMessage(
PlayerText(Player),
PointsText(CurrentPlayerStats.Points),
WinsText(CurrentPlayerStats.Wins))
StatsBillboard.SetText(PlayerStatsText)
# Update the stats billboards by sorting them based on the amount of lifetime points
# each player has.
UpdateStatsBillboards<public>(Players:[]agent, StatsBillboards:[]billboard_device):void=
var PlayerAndStatsArray:[]player_and_stats =
for:
Agent:Players
Verse Library
verse
30 Player Leaderboards Verse
Sorts players by points and updates in-game billboard devices with current stats and wins.
extracted-snippets/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse/30-player-leaderboards-verse.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.