The Loot Goblin’s Revenge: Building a Dynamic Elimination Arena
The Loot Goblin's Revenge: Building a Dynamic Elimination Arena
You've played the standard Battle Royale. You've played Team Rumble. But have you ever played a mode where every time someone drops, the loot table changes? Welcome to the Elimination Game, but with a twist. Instead of a static "win 10 games" screen, we're going to build a system where players earn better gear as they rack up kills, and when they get eliminated, they drop their current loadout like a guilty conscience.
We're going to use Verse to hook into the Elimination Manager, the device that tracks who knocked who out of the match. By the end of this article, you'll have a working "kill-to-upgrade" loop. It's simple, it's chaotic, and it makes your island feel like a high-stakes casino where the house always wins (but you might get rich if you're good enough).
What You'll Learn
- The Scene Graph & Entities: Understanding how your island is made of digital "actors" that talk to each other.
- Variables: How to track a player's "kill count" (a number that changes during the game).
- Events: Listening for the specific moment a player gets eliminated, like hearing a storm close in.
- Item Granting: Programmatically handing players weapons based on their performance.
How It Works
In Fortnite Creative, everything is an Entity. Think of an Entity as a player in a video game. It has stats, it has inventory, and it has a location. When you place an Elimination Manager in your island, you're placing a specific type of Entity that watches the battlefield.
Normally, if you want to give a player a weapon, you drag an Item Granter onto the map and set it to "On Player Entry." That's static. It happens once.
But we want dynamic behavior. We want to say: "If Player A eliminates Player B, and Player A has fewer than 3 kills, give them a Shotgun."
To do this, we need three things:
- A Variable: A container to store the number of kills. In Fortnite terms, this is like the "Eliminations" stat on the scoreboard, but we're going to read it in real-time using code.
- An Event Listener: This is like a tripwire. We don't want to check every second if someone died (that's wasteful). We want the code to wake up only when an elimination happens.
- The Logic: The "If/Then" statement. If the killer has 0-2 kills, then give them a Shotgun. Else, give them a Rocket Launcher.
This is the core of Verse: reacting to game state changes. You aren't just placing objects; you're programming the rules of engagement.
Let's Build It
We are going to create a Verse script that runs on an Island Script (a special entity that lives in the root of your scene graph). This script will listen for elimination events and modify the player's inventory.
The Setup
- Open UEFN and create a new island.
- Place an Elimination Manager device anywhere on the map. This is crucial; without it, the game doesn't track eliminations properly for Verse to hook into.
- Create a new Verse Script in the Content Browser. Name it
KillRewards. - Open the script in the editor.
The Code
Here is the complete, annotated Verse code. Copy this into your script.
# KillRewards.verse
# This script listens for eliminations and upgrades the winner's weapon.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Playspaces }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We define our main script here. Think of this as the "Brain" of the island.
# It must be a creative_device so UEFN can place it on the island as an actor.
KillRewards := class(creative_device):
# Step 1: Reference the Elimination Manager.
# In Verse, we declare a device property and then wire it up in the
# UEFN Details panel — drag your placed Elimination Manager into this slot.
@editable
EliminationManager : elimination_manager_device = elimination_manager_device{}
# Step 2: Per-player kill counter.
# We use a weak_map so entries are cleaned up automatically when a player leaves.
# var means the map itself can be replaced with an updated copy.
var KillCounts : [player]int = map{}
# OnBegin is the Verse entry point — called once when the game session starts.
OnBegin<override>()<suspends> : void =
# Step 3: Subscribe to the EliminationManager's elimination event.
# EliminatedEvent fires with an ?agent whenever a player
# is knocked out. We pass our handler as the subscriber.
EliminationManager.EliminationEvent.Subscribe(OnElimination)
# Step 4: Our handler — called automatically each time an elimination occurs.
# The EliminationEvent passes an ?agent representing the eliminating agent.
OnElimination(EliminatingAgent : ?agent) : void =
# Pull the eliminating agent out of the option type.
# It is an ?agent (option type) because environment kills have no killer.
if (EliminatingAgentValue := EliminatingAgent?):
# Cast the agent to a player. Bots are agents but not players.
if (EliminatingPlayer := player[EliminatingAgentValue]):
# Step 5: Look up — or initialise — the player's kill count.
CurrentKills : int =
if (Existing := KillCounts[EliminatingPlayer]):
Existing
else:
0
# Increment and store the new count.
NewKills := CurrentKills + 1
if (set KillCounts[EliminatingPlayer] = NewKills) {}
# Step 6: The Logic (If/Else).
# Fewer than 3 kills → "Noob" tier → grant a Shotgun via Item Granter.
# 3 or more kills → "Pro" tier → grant a Rocket Launcher.
#
# Real Verse has no bare Items.Shotgun constant; item granting is done
# through item_granter_device instances wired up in the Details panel.
# Wire "ShotgunGranter" to an Item Granter set to grant a Shotgun,
# and "RocketGranter" to one set to grant a Rocket Launcher.
if (NewKills < 3):
ShotgunGranter.GrantItem(EliminatingPlayer)
Print("Got a Shotgun! Keep killing!") # note: prints to UEFN log
else:
RocketGranter.GrantItem(EliminatingPlayer)
Print("You're on fire! Here's a Rocket Launcher!")
# Step 7: Item Granter device references.
# Wire these in the UEFN Details panel to Item Granter devices placed on the map.
# Set each Item Granter's item to the weapon you want to award.
@editable
ShotgunGranter : item_granter_device = item_granter_device{}
@editable
RocketGranter : item_granter_device = item_granter_device{}```
### Walkthrough: What Just Happened?
1. **`using` statements:** These are like opening your backpack to make sure you have the right tools. We're telling Verse, "Hey, I need to talk to Devices and Characters."
2. **`@editable` device properties:** Rather than searching the scene by name at runtime, Verse lets you declare device references with `@editable` and then wire them up by dragging your placed devices into the matching slots in the UEFN Details panel. This is the standard, reliable way to reference scene devices. *Make sure you wire up all three slots — EliminationManager, ShotgunGranter, and RocketGranter — before playtesting!*
3. **`EliminationManager.EliminationEvent.Subscribe(OnElimination)`**: This is our tripwire. `EliminationEvent` is a real `listenable` on `elimination_manager_device`. Calling `.Subscribe` tells Verse to call our handler function every time an elimination fires, passing an `elimination_result` struct.
4. **`elimination_result` and option unwrapping:** The result carries an `?agent` for the eliminator — it is optional because zone damage and the storm have no killer. We use `if (EliminatingAgent := Result.EliminatingAgent?)` to safely unwrap it, then `player[EliminatingAgent]` to confirm the agent is actually a human player.
5. **`var KillCounts : [player]int`**: Verse maps are value types, so we mark the variable `var` and use `set` to replace it with an updated copy each time the count changes. This gives us a per-player scoreboard in memory.
6. **`item_granter_device.GrantItem(player)`**: This is the correct API for handing a player a weapon in Verse. You configure *which* item is granted by setting the Item Granter device's properties in the UEFN Details panel, keeping data out of code and making iteration much faster.
## Try It Yourself
The code above gives a Shotgun or Rocket Launcher based on kill count. But it doesn't *remove* their old weapons, so they end up with a shotgun, a rocket launcher, a pickaxe, and a healing item, all at once. That's messy.
**Challenge:** Modify the script to **clear the player's inventory** before granting the new weapon.
**Hint:** Look up the `ClearInventory` function in the Verse documentation for `Player`. It's like hitting the "Reset" button on their loadout. Place it *before* the `GrantItem` lines.
**Hint 2:** You might want to give them a basic Pickaxe back after clearing, so they can still build/edit!
## Recap
You just built a dynamic game loop using Verse. You learned how to:
1. Bind to a device (Elimination Manager) in the Scene Graph.
2. Listen for an event (OnElimination).
3. Read a variable (Kill Count).
4. Modify the game state (Grant/Clear Inventory).
This is the foundation of everything you'll do in UEFN. From rotating loadouts to dynamic storm phases, it all starts with listening to events and changing variables. Now go make some islands that actually punish bad aim.
## References
* https://dev.epicgames.com/documentation/en-us/fortnite/create-an-elimination-game-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/create-an-elimination-game-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-creative-glossary
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/fortnite-creative-glossary
* https://dev.epicgames.com/documentation/en-us/fortnite/create-a-free-for-all-game-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add create-an-elimination-game-in-fortnite-creative 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.