The Gold Standard: Building a Fortnite Island Economy with Verse
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.
The Gold Standard: Building a Fortnite Island Economy with Verse
So, you want to stop giving away loot for free and start charging players for it? Welcome to the dark side of island creation, where money talks and players walk (or rather, pay). In this tutorial, we’re going to build a simple "Black Market" system. Think of it like the Battle Bus, but instead of dropping you into the island, it drops you into a shop where you have to pay Gold to get your gear.
We’ll use Verse to make a Conditional Button that checks if a player has enough Gold in their wallet. If they do, it unlocks a rare weapon. If they don’t, it tells them to go grind elsewhere. No more freebies.
What You'll Learn
- Variables as Wallets: How to check a player’s current Gold balance using a simple "if/else" logic.
- The Conditional Button: A device that acts like a bouncer at an exclusive club—it only lets you in if you can pay the cover charge.
- Scene Graph Hierarchy: Understanding how your Verse script "talks" to the buttons and spawners in your world.
- Real-World Application: Building a working mini-shop where players trade currency for power.
How It Works
Before we write a single line of code, let’s map this to something you already know: Loot Drops.
In a normal Fortnite match, loot drops are random. You jump out of the bus, and boom, you might get a Mythic gun, or you might get nothing. It’s RNG (Random Number Generation). But in Creative, we want Deterministic Rewards. You pay X Gold, you get Y Item. No surprises.
To do this, we need two things:
- The Check: A way to see how much Gold a player has. In programming, this is called a Variable. Think of a variable like a player’s inventory slot. It holds a value (like "500 Gold") that can change. If you spend 100, the variable updates to "400".
- The Gatekeeper: A device that says, "If the variable is greater than or equal to the price, open the door." In UEFN, this is the Conditional Button. It’s like a storm wall that only opens if you have a specific key item.
The Scene Graph: Who Talks to Whom?
In Unreal Engine (and Verse), everything exists in a Scene Graph. This is just a fancy way of saying "The Family Tree of Objects."
Imagine your island is a house.
- The House is the Island.
- The Rooms are the levels.
- The Furniture are the devices (buttons, spawners).
Your Verse script is like a smart home assistant. It doesn’t magically control the furniture; it has to know which button to push and which spawner to activate. We do this by referencing the Entity (the object) in the scene graph.
If you have a button named "ShopButton" and a spawner named "RareGunSpawner," your script needs to know: "Hey, ShopButton, if the player has money, tell RareGunSpawner to spawn."
Let's Build It
We are going to build a script that sits on a Conditional Button. When a player interacts with it, the script checks their Gold. If they have enough, it triggers a Item Granter (or Spawner) to give them a weapon, and then subtracts the Gold from their wallet.
Step 1: The Setup (No Code Yet)
- Place a Conditional Button in your island. Name it
ShopButtonin the details panel. - Place an Item Granter nearby. Name it
GoldReward. - Go to the Item Granter settings and set it to grant a weapon you want to sell (e.g., an Assault Rifle).
- Crucial Step: You need to register Gold as a consumable for the button. Select the Conditional Button, look for the Currency field in the details panel, and select Gold. Set the Required Amount to
500.
Wait, why do we set it in the details panel? Because Verse is powerful, but it’s also lazy. It’s easier to let the device handle the basic "do I have 500 gold?" check than to write complex math code for it. We’ll use Verse to handle the result of that check.
Step 2: The Verse Script
Now, let’s add the logic. We’ll create a Verse script that listens for when the button is pressed. If the button is "active" (meaning the player paid), we grant the item.
Create a new Verse script in your project. Let’s call it BlackMarketLogic.
# This is a comment. It's like a sticky note on your code that the game ignores.
# We are defining a script that runs on the ShopButton entity.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# This is our main script block. Think of it as the "Brain" of the button.
BlackMarketLogic := class(creative_script):
# This is a VARIABLE. It’s a container for our button.
# We call it 'shop_button' and it holds a 'conditional_button_device'.
shop_button: conditional_button_device = conditional_button_device{}
# This is another VARIABLE for our item granter.
# We call it 'reward_granter'.
reward_granter: item_granter_device = item_granter_device{}
# This function runs when the script starts. It's like loading the map.
OnBegin<override>()<suspends>: void =
# Here we are "Registering" an event.
# Think of this as setting up a trap. We don't know when it triggers,
# but when it does, we want to run 'OnButtonPressed'.
# shop_button.ActivatedEvent.Register(self, OnButtonPressed)
# Note: In Verse, we often use 'Bind' or direct event registration.
# For simplicity in this beginner example, we'll assume a direct trigger flow.
# Let's register the event listener.
shop_button.ActivatedEvent += func(event: conditional_button_device_activated_event):
OnButtonPressed(event)
# This is a FUNCTION. A function is like a recipe.
# It takes an input (the event) and does something.
OnButtonPressed(event: conditional_button_device_activated_event)<suspends>: void =
# The button was pressed AND the currency check passed!
# Now we need to give the player the item.
# Get the player who pressed the button.
# 'event.Get_Instigator()' gets the player who triggered the event.
player := event.Get_Instigator()
if (player != null):
# Grant the item to the player.
# 'Grant()' is the function that says "Here, take this."
reward_granter.Grant(player)
# Optional: Send a message to the player.
# "Thanks for your money!"
player.Send_message("Item Granted! Enjoy your gear.")
Walkthrough: What Just Happened?
using { ... }: These are Imports. Think of them as grabbing tools from the toolbox. We need theDevicestoolbox to talk to buttons and granters, andSimulationto handle game time and events.shop_button: conditional_button_device = {}: This is a Variable Declaration. We created a slot in our script’s memory namedshop_buttonand told it to hold aconditional_button_device. The{}is an empty placeholder. In the Unreal Editor, you’ll actually drag and drop the button into this slot in the script’s details panel, but in pure Verse, we often reference them by name or handle them via events. For this tutorial, we assume you’ve linked the devices in the editor’s script properties.OnBegin: This is the Constructor. It runs once when the game starts. Its job is to set up the Event Listener.ActivatedEvent += func(...): This is Event Binding. It’s like saying, "When the button is pressed, run this code." The+=means "add this function to the list of things to do when the event fires."event.Get_Instigator(): This gets the Player. In game terms, the "Instigator" is the entity that caused the action. If you shoot a wall, you’re the instigator. If you press a button, you’re the instigator.reward_granter.Grant(player): This is the Action. We call theGrantfunction on our item granter, passing in the player. It’s like handing them the loot.
Try It Yourself
The script above is a good start, but it’s not perfect. It doesn’t actually check the gold balance in the code—it relies on the device’s built-in settings. Your challenge is to make the system smarter.
Challenge: Modify the script so that if the player doesn’t have enough gold, they get a custom message saying "Not enough Gold! Go get more!" instead of just doing nothing.
Hint: You’ll need to use an Else statement. In Fortnite terms, an if statement is like checking if you have a shield. If you do, you’re safe. If you don’t (else), you’re vulnerable. Try to structure your code like this:
Wait, how do we check player_has_enough_gold in Verse? That’s the tricky part! The Conditional Button handles the check for you. If the button activates, they had enough. If it doesn’t activate, they didn’t. So, how do we know if they tried and failed?
Better Challenge: Add a Timer device. When the player buys the item, the shop button should lock for 10 seconds so they can’t spam it. Use a Timer variable to track the cooldown.
Recap
You just built a basic economic system for your Fortnite island. You learned that:
- Variables are like inventory slots that hold data (like Gold amounts).
- Functions are recipes for actions (like granting items).
- Events are triggers that start your code (like pressing a button).
- The Scene Graph is the family tree that lets your script talk to devices.
You’re no longer just playing Fortnite; you’re running the economy. Next time you see a shop in another island, you’ll know exactly how they’re tracking your Gold. Now go forth and charge your friends for loot!
References
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-gold-consumables-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-gold-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/pinbrawl-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-consumables-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/pinbrawl-island-tutorial-in-fortnite-creative
Get the complete code — free
You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.
Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.
Verse source files
- 01-standalone.verse · standalone
- 02-fragment.verse · fragment
Turn this into a guided course
Add using-gold-consumables-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.