Verse Library verse

01 Device

Executes a single-use trap sequence on trigger, granting items and moving props once.

verse-library/triggers-1-5/01-device.verse

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

# We are creating a "Device" which is a container for our logic.
# Think of this as the "Island" object that holds our specific trap.
one_shot_trap := class(creative_device):

    # This is our "Family Tree" reference.
    # We are telling Verse: "Hey, inside this Island, there is a device
    # named 'LootTrigger'. Connect it to this script."
    # Drag your trigger device onto this property in the UEFN details panel.
    @editable
    LootTrigger : trigger_device = trigger_device{}

    # We also grab the Item Granter and the Prop Mover.
    # If these aren't connected in the details panel,
    # Verse will complain. Accuracy is key!
    @editable
    LootBox : item_granter_device = item_granter_device{}

    @editable
    LootBoxProp : prop_mover_device = prop_mover_device{}

    # This is our "Inventory Slot" (Variable).
    # It starts as false, meaning the trap is READY.
    # <var> marks this as mutable so we can change it later.
    var IsTrapUsed : logic = false

    # OnBegin runs automatically when the game starts.

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