The Score Heist: How to Steal Points with Verse
The Score Heist: How to Steal Points with Verse
You know that feeling when you snipe someone from across the map and get 200 points? Or when you grab a key item and suddenly your score jumps? That’s the Score Manager having a party. But what if you want to be sneaky? What if you want to trick the system into thinking you grabbed the item, or steal points from a rival who just died?
In this tutorial, we’re going to build a "Point Thief" trap. It’s a simple device that lets one player (the thief) steal the current score of another player (the victim) and add it to their own total. No more grinding for kills—just pure, unadulterated score piracy. We’ll use a Verse function called SetToAgentScore to make it happen.
What You'll Learn
- Agents: Who is the "player" in the code? (Spoiler: It’s not just a number).
- The Score Manager: The device that keeps track of everyone’s points.
SetToAgentScore: The specific Verse command that grabs a player’s current score and prepares it for transfer.- Logic Flow: How to chain events so the theft only happens when you press a button.
How It Works
Before we write any code, let’s talk about the game mechanics. In Fortnite, your score is usually tied to your character (your Agent). When you eliminate someone, the Score Manager says, "Hey, Player A got a point!" and updates Player A’s total.
SetToAgentScore is like a photocopier for scores. Normally, when you do something cool (like press a button or kill a boss), the game awards a fixed amount (like +10 points). But SetToAgentScore changes the rules. It says: "Don’t give me 10 points. Look at Player B’s current score, and that is the amount I’m about to award to the person who triggered this."
It’s the digital equivalent of looking at your friend’s wallet, noting how much cash they have, and then magically transferring that exact amount into your pocket.
The Scene Graph: Who is the Agent?
In Verse, an Agent is any entity that can have a score. In most Fortnite islands, this is the Player Character. Think of the Agent as the "container" for your stats. If you want to steal someone’s score, you need to point your code at their specific Agent container.
We’ll use a Trigger Volume (a zone on the ground) and a Button. When Player A steps on the trigger and presses the button, our Verse script will:
- Identify Player A as the "Thief."
- Identify Player B as the "Victim."
- Use
SetToAgentScoreto tell the Score Manager: "Prepare to award Player A an amount equal to Player B’s current score." - Actually award it.
Let's Build It
We need three things in our UEFN level:
- A Trigger Volume (set to "Player Only").
- A Button (any prop, like a button plate).
- A Score Manager device (from the Devices menu).
Now, let’s write the Verse. This script goes on the Trigger Volume.
using { /Fortnite.com/Devices }
# This is our "Thief Trap" script.
# It lives on a Trigger Volume.
trigger: TriggerVolume = script.GetTriggerVolume()
button: Button = script.GetButton("Button")
score_manager: ScoreManager = script.GetScoreManager()
# We need to know who the victim is.
# For simplicity, let's say the victim is the player
# who spawned in last, or we can hardcode an index.
# Here, we'll use a variable to store the victim's Agent.
# In a real game, you'd pick this dynamically.
victim_agent: agent = script.GetPlayerAgent(0) # Player 1 is our victim
# This function runs when the trigger is entered or button is pressed.
# 'agent' here is the PLAYER (the thief) who triggered it.
on_thief_action := func(agent: agent):
# Step 1: Get the victim's current score.
# We use GetAgentScore to see how much loot the victim has.
victim_score: int = score_manager.GetAgentScore(victim_agent)
# Step 2: Set the award for the NEXT action.
# This is the magic line. We tell the Score Manager:
# "When the thief does something, give them 'victim_score' points."
score_manager.SetToAgentScore(victim_agent)
# Step 3: Actually give the points to the thief.
# We do this by "activating" the score manager for the thief.
# In Verse, you often need to trigger the award manually
# or use a device that awards points.
# For this demo, we'll assume the trigger activation itself
# awards points, but we need to ensure the thief is the one
# receiving it.
# Note: SetToAgentScore sets the *amount* to be awarded to the
# *next activation*. We need to trigger that activation for the thief.
# To keep it simple in Verse, we can use the ScoreManager's
# activation to award the point to the 'agent' (thief).
# However, SetToAgentScore specifically sets the score
# *of the agent passed to it* to be the award amount
# for the *next* activation of the ScoreManager.
# Let's activate the ScoreManager for the thief.
score_manager.Activate()
# Connect the events.
# When the button is pressed, run the theft function for the player who pressed it.
button.Pressed.Bind(func(agent: agent):
on_thief_action(agent)
)
# Optional: Also trigger if they just walk into the zone.
# trigger.Entered.Bind(func(agent: agent):
# on_thief_action(agent)
# )
Walkthrough: What Just Happened?
using { /Fortnite.com/Devices }: This is like loading the "Game Mechanics" DLC. It lets us talk to the Score Manager, Buttons, and Triggers.victim_agent: agent = script.GetPlayerAgent(0): We picked a victim. In a real game, you’d probably pick a random enemy. Here, we’re just stealing from Player 1.score_manager.SetToAgentScore(victim_agent): This is the core concept. It doesn’t move the points yet. It just says, "Okay, the next time we award points, make the award amount equal to whatevervictim_agenthas right now."score_manager.Activate(): This is the "handoff." Now that the amount is set, we activate the manager. The manager looks at the current context (who triggered it?) and awards the set amount to that person.
Try It Yourself
Challenge: Right now, you can only steal from Player 1. Make it so you steal from anyone who is near you.
Hint: You’ll need to use a loop to check all players in the game, find the one closest to the thief, and set them as the victim_agent dynamically before calling SetToAgentScore. (Don’t worry if the loop looks scary—just look up ForEachPlayer in the Verse docs!)
Recap
- Agents are the players (or entities) that hold scores.
SetToAgentScoreis a Versatile tool that sets the amount of the next score award to match a specific Agent’s current score.- It’s perfect for heists, revenge mechanics, or chaotic party modes where score values change based on who you’re fighting.
- Always remember:
SetToAgentScoresets the value, you still need to activate the award to actually give the points.
References
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/score_manager_device/settoagentscore
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/score_manager_device/settoagentscore
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/conditional_button_device/setitemscore
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/conditional_button_device/setitemscore
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/score_manager_device/setscoreaward
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add settoagentscore 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.