Verse Library verse

01 Device

Removes an item from a player and grants a reward when they step into a trigger zone.

verse-library/using-mineral-powder-items-in-fortnite-creative/01-device.verse

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

# Create a new Verse device. Think of this as a "Brain" attached to a device.
# It lives in the world and reacts to events.
powder_processor := class(creative_device):

    # Wire this to a Trigger device placed in your UEFN scene.
    # Players walk into the trigger to start the crafting check.
    @editable
    CraftTrigger : trigger_device = trigger_device{}

    # Wire this to an Item Granter device set to grant a Shield Potion.
    # The Item Granter handles the actual item delivery to the player.
    @editable
    RewardGranter : item_granter_device = item_granter_device{}

    # Wire this to an Item Remover device configured to remove
    # Rough Mineral Powder (quantity 1) from the player's inventory.
    @editable
    PowderRemover : item_remover_device = item_remover_device{}

    # OnBegin runs once when the island loads — your "Start Game" event.
    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger's TriggeredEvent so we react every
        # time a player walks into the trigger zone.
        CraftTrigger.TriggeredEvent.Subscribe(OnPlayerTriggered)

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