The Ultimate Loot Drop: Building a Self-Refilling Health Station with Verse
Tutorial beginner

The Ultimate Loot Drop: Building a Self-Refilling Health Station with Verse

Updated beginner

The Ultimate Loot Drop: Building a Self-Refilling Health Station with Verse

So, you’ve built the perfect arena. You have traps, you have sniping spots, and you have a storm that actually moves. But there’s one problem: your players are dying of boredom because they have to run all the way back to the start to heal.

In traditional Fortnite, you spawn with a shield and hope for the best. In UEFN (Unreal Editor for Fortnite), we don’t hope. We code.

In this tutorial, we’re going to build a Smart Health Station. This isn’t just a chest you open once. It’s a device that checks if a player is low on health, gives them a boost, and then resets itself so the next person in line can use it. We’ll use Verse to handle the logic, turning a static prop into a dynamic game mechanic that feels like magic.

What You'll Learn

  • Variables: How to store a "cooldown" timer so the station doesn’t heal everyone at once.
  • Events: How to listen for when a player interacts with an object (like pressing E).
  • Logic: How to check a player’s health and only act if they need it.
  • Scene Graph Basics: Understanding how your Verse script "talks" to the devices in your island.

How It Works

Imagine a vending machine. You don’t just grab a soda and run; you have to press a button. If someone else just bought a soda, the machine might say, "Hold on, I’m restocking." That’s exactly what we’re building.

Here is the game mechanic we are translating into code:

  1. The Trigger: A player stands near the station and presses E. In programming terms, this is an Event—a specific moment in time that something happened.
  2. The Check: The code asks, "Is this player hurt?" (Health < 100). If they are at full health, we do nothing. No waste.
  3. The Reward: If they are hurt, we give them a Hop Rock (for speed) or a Shield Potion.
  4. The Cooldown: We set a Variable (a changing value) to True to say "Station is busy."
  5. The Reset: A Timer waits a few seconds, then sets the Variable back to False, allowing the next player to use it.

Key Concept: The Scene Graph

Before we write code, you need to understand the Scene Graph. Think of your island as a giant family tree.

  • The Island is the parent.
  • Devices (like the Health Station) are children.
  • Verse Scripts are the brains that live inside those children.

When you write Verse, you are telling a specific device what to do. The script doesn’t float in the air; it’s attached to an object. That object is your entry point.

Let's Build It

We are going to create a script that turns a simple Prop into a healing station.

Step 1: Set Up Your Island

  1. Open UEFN and create a new island.
  2. Place a Static Prop (like a crate or a futuristic box) in the center of your map.
  3. In the Properties panel on the right, give it a Name. Let’s call it HealthStation. This name is crucial—it’s how our code will find the box.
  4. Go to the Verse tab in the top menu. Create a new Verse file. Name it HealthStationScript.

Step 2: The Code

Copy this code into your new Verse file. I’ve added comments (lines starting with #) to explain what’s happening.

# This line tells Verse: "Hey, this script belongs to a specific device."
# We link it to the 'HealthStation' prop we placed in the world.
struct MyHealthStation extends Actor:
    # This is our 'Cooldown' variable.
    # Think of it like a 'Ready/Busy' light.
    # 'false' means the station is ready to use.
    IsBusy: bool = false
    
    # This is the timer device.
    # We will use this to wait before resetting the station.
    ResetTimer: Timer = Timer{}
    
    # This is the 'Event' function.
    # It runs automatically when a player presses E on this object.
    # 'Player' is the person who pressed the button.
    OnInteract(Player: Player):
        # CHECK 1: Is the station currently busy?
        # If IsBusy is true, we skip the rest of this code.
        if (IsBusy):
            # Optional: You could play a sound here saying "Wait!"
            return
        
        # CHECK 2: Is the player actually hurt?
        # We check their current health. If it's less than 100, they need help.
        if (Player.GetHealth() < 100):
            
            # REWARD: Give them a Shield Potion.
            # We use the 'Item' device to grant the item directly to the player.
            # Note: In a real scenario, you'd use the Item Device from the gallery.
            # For this script, we simulate the effect by healing them directly.
            Player.Heal(50)
            
            # OPTIONAL: Give them a Hop Rock for fun!
            # Player.GiveItem("Hop_Rock") # Uncomment if you have the item ID
            
            # UPDATE: Set the station to 'Busy'.
            # Now other players can't use it until the timer finishes.
            IsBusy = true
            
            # ACTION: Start the cooldown timer.
            # We tell the timer to wait 5 seconds, then call 'OnTimerFinished'.
            ResetTimer.Start(5.0, OnTimerFinished)
        
    # This function runs AFTER the timer finishes.
    OnTimerFinished():
        # The wait is over! Reset the 'Busy' light to green.
        IsBusy = false

Walkthrough: What Just Happened?

  1. struct MyHealthStation extends Actor: This defines our script. Actor is the base class for anything in the game world that can move or interact. By extending it, we’re saying, "This script controls an object in the world."

  2. IsBusy: bool = false This is our Variable. A variable is like a storage box that can change its contents. Here, we created a box labeled IsBusy that holds a bool (short for boolean, which is just a switch that is either true or false). We started it as false (not busy).

  3. OnInteract(Player: Player): This is the Event. It’s a function that Verse calls automatically when the game detects a player interacting with the object this script is attached to. The Player: Player part means "Give me the data about the player who did this."

  4. if (IsBusy): This is Conditional Logic. It’s like a gatekeeper. "If the station is busy, stop right here and do nothing."

  5. Player.GetHealth() < 100 We’re checking the player’s status. If they have less than 100 health, the condition is true, and we proceed to the reward.

  6. ResetTimer.Start(5.0, OnTimerFinished) This is the Timer. We tell it to wait 5.0 seconds. When those 5 seconds are up, it triggers the OnTimerFinished function.

  7. IsBusy = false Inside OnTimerFinished, we flip the switch back. The station is now ready for the next victim.

Try It Yourself

The code above is a solid start, but it’s not very "Fortnite." It just heals you silently. Let’s make it more chaotic.

Challenge: Modify the script to add a Sound Effect when the station activates.

Hint:

  1. Find a Sound Device in the UEFN gallery.
  2. Place it near your Health Station.
  3. In the Verse code, you can reference devices by their name. If your sound device is named HealSound, you can trigger it with HealSound.Play().
  4. Try adding HealSound.Play() right after you give the player the health boost.

Don’t worry if you get stuck! The key is to make sure the Sound Device is named exactly HealSound in the Properties panel, or the code won’t find it.

Recap

You’ve just built your first interactive Verse device! You learned how to:

  • Use Variables to track state (Busy/Not Busy).
  • Handle Events (Player Interaction).
  • Use Logic to check player health.
  • Use a Timer to reset the game state.

This is the foundation of all Fortnite Creative. Whether you’re building a battle royale map or a racing track, you’re always asking: "What happens when the player does X?" And now, you have the tools to answer that question.

Go forth and code. And remember: if your code breaks, check your variable names. It’s always the variable names.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-items-gallery-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-chest-and-ammo-gallery-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/exploring-the-content-browser-menu-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/exploring-the-content-browser-menu-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-consumables-gallery-devices-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-items-gallery-devices-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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in