Build Your Own Score Tracker in Fortnite
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
Build Your Own Score Tracker in Fortnite
Have you ever played a game and wanted to track something special? Maybe how many coins you collect or how fast you run. Fortnite Creative lets you do this! We will build a custom score tracker. It is like a digital scoreboard for your island. You will learn how to create a stat and change it using devices. Let's make your game unique.
What You'll Learn
- How to create a Stat Creator device.
- How to name and color your own score.
- How to change the score using a Stat Powerup.
- How to keep the score hidden from players.
How It Works
Think of a Stat like a score counter in a video game. It holds a number. This number can go up or down. We need two main tools to make it work.
First, we need a Stat Creator. This is the brain. It defines what the stat is. You give it a name. You pick a color. You set a maximum number. It is like setting up a new scoreboard before a game starts.
Second, we need a Stat Powerup. This is the action. It changes the number in the stat. Usually, powerups are things you pick up. But we can make it special. We can hide the powerup. Then, we can trigger it with other devices. This lets us change the score when players do something cool.
Let's build a "Grid Score." This will track how many tiles a player places in a puzzle game.
Let's Build It
We will build a simple system. First, we create the score. Then, we add a way to increase it.
Step 1: Create the Scoreboard
- Open your Fortnite Creative island.
- Go to the Devices menu.
- Search for Stat Creator.
- Place it in your world. It can be anywhere.
- Click on it to open the settings.
- Change these settings:
- Stat Name: Type
Grid Score. - Max Value: Type
100. This is the highest score allowed. - Stat Icon: Choose
Sprint. It looks like a running person. - Stat Color: Pick a bright color like yellow.
- Stat Name: Type
Now you have a named score! It is ready to count.
Step 2: Add the Power to Change It
- Go to the Devices menu again.
- Search for Stat Powerup.
- Place it somewhere you can't reach. Maybe high up in the sky.
- Click on it to open the settings.
- Change these settings:
- Stat to Apply: Select
Grid Score. This links it to our creator. - Magnitude: Type
10. This adds 10 points each time. - Infinite Effect Duration: Turn this On. The effect lasts forever.
- Time To Respawn: Set to
Instant. It reappears right away. - Who Can See This Powerup: Set to
None. Players won't see it.
- Stat to Apply: Select
Step 3: Make It Work in Verse
Devices are great, but Verse gives you more control. Let's write a small script. This script will wait for a player to join. Then it will activate our powerup.
Here is the code. Copy this into a Verse file in your project.
# This is a simple Verse script.
# It runs when the island starts.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
# This is our main script block.
# It holds all our code.
grid_score_script := class(creative_device):
# Drag your Stat Powerup device into this property
# in the UEFN Details panel before pressing Play.
@editable
ScoreBooster : stat_powerup_device = stat_powerup_device{}
# This function runs when the game starts.
OnBegin<override>()<suspends>: void =
# We wait a tiny bit. This is safe.
Sleep(1.0)
# Get all players currently in the game.
AllPlayers := GetPlayspace().GetPlayers()
# Loop through each player and apply the powerup.
for (Player : AllPlayers):
# This will add 10 to the Grid Score for each player.
ScoreBooster.ApplyToPlayer(Player)
# Let's print a message to the console.
Print("Score increased!")
What Does the Code Do?
OnBeginis a special function. It runs automatically when the game starts.@editablemarksScoreBoosterso you can drag your Stat Powerup device into it from the UEFN Details panel. There is noworld.GetDevicelookup in real Verse — you wire devices through editable properties instead.Sleep(1.0)pauses the script for one second. This is the correct Verse function for waiting.GetPlayspace().GetPlayers()returns every player on the island as an array.- The
forloop visits each player one at a time. ScoreBooster.ApplyToPlayer(Player)sends the powerup effect to that specific player.Printshows a message in the debug console. It helps you check if the code works.
Try It Yourself
You did it! You built a custom stat. Now, try this challenge.
Challenge: Make a "Health Stat" instead of a Score.
- Create a new Stat Creator.
- Name it
Player Health. - Set the Max Value to
100. - Pick a red color for it.
- Create a Stat Powerup.
- Set it to subtract
20from the health. - Connect it to a Trigger Volume.
Hint: Use a Trigger Volume device. When a player walks into it, the trigger activates the powerup. This will make the player lose health!
Recap
You learned how to create a custom stat in Fortnite Creative. You used a Stat Creator to define the score. You used a Stat Powerup to change it. You even wrote a little Verse code to automate it. Stats are powerful. They let you track anything. Keep building and have fun!
References
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/stat-powerup-device-design-examples
- https://dev.epicgames.com/documentation/en-us/fortnite/stat-powerup-device-design-examples-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/stat-creator-design-examples
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/stat-counter-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/stat-counter-design-examples-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add Configure the Custom Stat to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.