How to Build a Bomb-Throwing Battle Arena
Tutorial beginner compiles

How to Build a Bomb-Throwing Battle Arena

Updated beginner Code verified

How to Build a Bomb-Throwing Battle Arena

Welcome, future game maker! Have you ever wanted to throw a bomb at your friends? Or maybe you want to build a game where players dodge sticky bombs or dance uncontrollably? In Fortnite Creative, you can do all of this. You don't need to code complex math. You just need to know how to use Ranged Weapon Items. These are fun tools like bombs, cans, and jars. They let players attack from a distance. Let's build a simple arena where players can grab these items and battle. It will be loud, messy, and very fun.

What You'll Learn

  • What a Ranged Weapon Item is.
  • How to place items so players can pick them up.
  • How to make a simple Item Spawner using Verse.
  • How to test your new battle arena.

How It Works

Think of a Ranged Weapon Item like a toy grenade. You hold it. You throw it. It does something cool. Maybe it explodes. Maybe it makes someone dance. Maybe it stinks!

In Fortnite Creative, these items are called Consumables. A Consumable is an item you use once. It disappears after you use it. It's like eating a cookie. You eat it, and it is gone.

There are two main types of these items:

  1. Ranged Weapons: Things like the Rusty Can or Shadow Bomb. You throw them to hit things.
  2. Explosives: Things like Dynamite or Bottle Rockets. They blow things up.

To give these to players, we use a device called an Item Spawner. An Item Spawner is a box in the game world. When a player walks near it, the box gives them an item. It is like a vending machine for weapons.

We will use Verse to write a small script. Verse is the language we use to tell the game what to do. Our script will place an Item Spawner. It will put a Rusty Can inside. When a player picks it up, they can throw it.

Let's Build It

We are going to create a single script. This script will create a "Loot Box" for a Rusty Can. A Rusty Can is a simple ranged weapon. You throw it, and it makes a loud noise. It is perfect for beginners.

Here is the code. Copy it into a new Verse file in your project.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

# This is our main script. It is like the brain of our spawner.
# We attach it to a Verse device placed on the island.
rusty_can_spawner := class(creative_device):

    # The editor will wire this item_spawner_device to our script.
    # Drag an Item Spawner device onto your island and connect it here.
    @editable
    Spawner : item_spawner_device = item_spawner_device{}

    # OnBegin runs automatically when the game starts.
    OnBegin<override>()<suspends> : void =
        # Tell the spawner to start giving out items right away.
        # The item type and count are set in the Item Spawner device
        # properties inside the editor (for example: Rusty Can, Count = 5).
        # note: item_spawner_device does not expose a runtime Set_Given_Item API;
        # configure the item and stack count in the device's property panel.
        Spawner.Enable()

Walkthrough of the Code

Let's look at what each part does.

  1. using statements: These are like opening your toolbox. We need the Devices toolbox. This gives us access to the Item Spawner.
  2. rusty_can_spawner: This is a class that extends creative_device. Every Verse script that runs on the island must be a creative_device. It is like a recipe. We follow the steps one by one.
  3. @editable Spawner: This is a slot you fill in the editor. You drag an Item Spawner device from your island into this slot. That connects the real device to our code.
  4. OnBegin: This function runs automatically when the game starts. It is the entry point for every creative_device.
  5. Spawner.Enable(): This turns the spawner on. If the spawner is disabled, it won't give items. Calling Enable() makes sure it is active and ready the moment the game begins.
  6. Item type and count in the editor: Open the Item Spawner device's property panel. Set the item to Rusty Can and the count to 5. The editor handles this configuration because item_spawner_device does not expose a runtime API for changing the item type mid-game.

How to Place It in Fortnite

  1. Open Fortnite Creative.
  2. Go to Create Mode.
  3. Open the Content Browser.
  4. Search for Verse Device.
  5. Drag the Verse Device onto your island.
  6. Also drag an Item Spawner device onto your island.
  7. Click on the Verse Device. Go to its Properties.
  8. Find the Script slot and select the script you just wrote.
  9. Find the Spawner slot and connect it to the Item Spawner device you placed.
  10. Click the Item Spawner device and set its item to Rusty Can and its count to 5 in its property panel.
  11. Press Play.

Now, walk toward the device. You will see a Rusty Can appear in your inventory. Pick it up. Throw it! Boom!

Try It Yourself

You made a Rusty Can spawner. Now, let's make it harder. Can you change the script to give players a Shadow Bomb instead?

A Shadow Bomb makes players invisible for a short time. It is very cool.

Hint: Click on the Item Spawner device in the editor. In its property panel, change the item from Rusty Can to Shadow Bomb. You might also want to change the count to a higher number, like 10. That way, you have enough bombs for a big battle.

Recap

You learned how to use Ranged Weapon Items. These are fun tools like bombs and cans. You used an Item Spawner to give these items to players. You wrote a small Verse script to make the spawner work. Now you can build your own battle arena. Keep experimenting. Try different items. Have fun!

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-ranged-weapon-items-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-ranged-weapon-consumables-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-explosive-items-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/using-attack-items-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-ranged-weapon-items-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