Verse Library verse

01 Fragment

Listens for overlap events to detect entering players or vehicles and applies a temporary movement speed boost.

verse-library/using-nitro-hoop-devices-in-fortnite-creative/01-fragment.verse

# This is the header. It tells Verse we are making a device script.
# Think of it as the "Title Screen" of your code.
using { /Fortnite.com/Devices }

# We define a "Script" which is like a blueprint for our Hoop.
# Every time you place a Nitro Hoop, you are creating an "instance" of this blueprint.
actor MyNitroHoopScript():
    # This is a "Variable". Think of it like a scoreboard or a status indicator.
    # It starts as False (no boost active).
    is_boost_active: bool = false

    # This is the "Main" function. It runs once when the island starts.
    # Think of it as the "Loadout Selection" screen—everything is set up here before the match begins.
    main():
        # We need to "listen" for when something enters the hoop.
        # This is called an "Event Listener".
        # Imagine a security guard standing at the hoop, waiting for someone to walk in.
        # When someone enters, the guard triggers the "OnActorBeginOverlap" event.
        OnActorBeginOverlap.Subscribe(OnPlayerEntersHoop)

    # This is a "Function". It’s a reusable block of code.
    # Think of it like a "Replay" button. You press it, and it plays the same sequence every time.
    OnPlayerEntersHoop(overlapping_actor: Actor):
        # We need to check if the thing that entered is a Player or a Vehicle.
        # If it's just a rock or a tree, we don't want to boost it.
        if overlapping_actor.IsA<Player>():
            # If it IS a player, we call our "Boost" function.
            ApplySpeedBoost(overlapping_actor)
        elif overlapping_actor.IsA<Vehicle>():
            # If it IS a vehicle, we also boost it.

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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