Level Up! How to Give Players Awesome Rewards
Tutorial beginner compiles

Level Up! How to Give Players Awesome Rewards

Updated beginner Code verified

Level Up! How to Give Players Awesome Rewards

Imagine you just beat a really hard video game level. You feel proud, right? That feeling is a reward. But games also give shiny items, points, and cool sounds. In this tutorial, we will make a simple game. You will create a "Victory Gate." When a player wins, they get a special item and a cool message. Let's make your island feel rewarding!

What You'll Learn

  • What intrinsic and extrinsic rewards are.
  • How to use an Item Granter to give players loot.
  • How to use an Accolades device to give players XP and badges.
  • How to connect these devices using Channels.

How It Works

Think of a reward like a treat at the end of a long walk. There are two kinds of treats.

First, there is the intrinsic reward. This is the good feeling inside. It is like the pride you feel when you solve a tough puzzle. You cannot see it, but you feel it. In games, this is the satisfaction of winning.

Second, there is the extrinsic reward. This is something you can see or touch. It is like getting a gold star sticker. It might be points, a badge, or a cool sword. We will build this part in Verse.

We will use two special devices. One is an Item Granter. This device gives players items from your inventory. The other is an Accolades device. This device gives players experience points (XP) and shows a message. We will connect them so they work together.

Let's Build It

We will build a "Winner's Portal." When a player steps on a special button, the portal opens. The player gets a Slurp Mushroom and a "You Won!" message.

Here is the Verse code to make this happen.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# This is our main script. It controls the victory gate.
WinnerGate := class(creative_device):
    # These are the devices we will use.
    # Think of them as tools in your toolbox.
    @editable
    VictoryTrigger : trigger_device = trigger_device{}
    @editable
    ItemGranter : item_granter_device = item_granter_device{}
    @editable
    Accolades : accolades_device = accolades_device{}

    # This runs when the game starts.
    OnBegin<override>()<suspends> : void =
        # Wait for the player to step on the trigger.
        # This is like waiting for a bell to ring.
        loop:
            # TriggeredEvent fires each time the trigger activates.
            MaybeAgent := VictoryTrigger.TriggeredEvent.Await()

            # The player stepped on the button!
            # Let's give them a reward.
            # TriggeredEvent returns a ?agent, so we unwrap it first.
            if (Agent := MaybeAgent?):

                # 1. Give them an item via the Item Granter device.
                # The Item Granter's inventory is configured in the editor.
                # Calling GrantItem() tells it to give its configured item
                # to the agent who activated the trigger.
                # # note: item_granter_device.GrantItem() accepts an agent
                # and grants whatever item is set up in the device properties.
                ItemGranter.GrantItem(Agent)

                # 2. Give them an accolade (XP and badge).
                # The accolade name and XP value are set in the editor.
                # Calling Award() triggers the device for this agent.
                # # note: accolades_device.Award() signals the device to
                # display the configured accolade for the given agent.
                Accolades.Award(Agent)

                # 3. Print a debug message confirming the reward fired.
                # Use a HUD Message device in the editor for in-game text.
                # # note: Print() writes to the output log; place a
                # hud_message_controller_device in the editor to show
                # on-screen text to players.
                Print("You Won! Great Job!")```

### Walkthrough

1.  **The Setup**: We tell Verse which devices we are using. We need a **Trigger** (the button), an **Item Granter** (the giver), and an **Accolades** device (the badge giver).
2.  **The Loop**: We use a `loop` block. It waits forever. It is like a guard standing at the gate.
3.  **The Trigger**: When `VictoryTrigger.TriggeredEvent.Await()` returns, the code wakes up. This means a player stepped on the button.
4.  **The Item**: We call `GrantItem(Agent)`. This tells the Item Granter device to give its configured item to the player. *Note: In the editor, you must add "Slurp Mushroom" to the Item Granter's inventory list.*
5.  **The Badge**: We call `Award(Agent)`. This tells the Accolades device to give the player XP and display the badge name configured in the editor.

### How to Set This Up in UEFN

Code is only half the work. You must place the devices in the editor.

1.  Place a **Trigger** device. Name it "Victory Button".
2.  Place an **Item Granter**. Name it "Victory Loot".
    *   Open its properties.
    *   Set **Grant Items When Receiving From** to **Channel 1**.
    *   Add "Slurp Mushroom" to its inventory list.
3.  Place an **Accolades** device. Name it "Winner Badge".
    *   Set **Award When Receiving From** to **Channel 1**.
    *   Set the Accolade Name to "Winner".
    *   Set the XP Award to "Large".
4.  Place your Verse script on the Trigger.
5.  Test your island! Step on the button. Do you get the mushroom and the badge?

## Try It Yourself

You did it! You made a reward system. Now, let's make it harder.

**Challenge:** Add a second reward. Make it so that if a player waits for 10 seconds on the button, they get a different item, like a "Shield Potion."

**Hint:** You can use a `Timer` device. Or, you can add a second Item Granter. Set the second Item Granter to listen on **Channel 2**. Then, change your Verse code to send a signal to Channel 2 after a delay.

## Recap

Rewards make games fun. **Intrinsic rewards** are feelings of pride. **Extrinsic rewards** are items and badges. We used an Item Granter to give loot. We used an Accolades device to give XP. We connected them with channels. Now your players will feel great when they win!

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite/how-to-design-a-game-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/how-to-design-a-game-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/pinbrawl-island-tutorial-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/pinbrawl-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/accolades-device-gameplay-examples-in-fortnite-creative

Verse source files

Turn this into a guided course

Add Rewards 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