Verse Library verse

01 Fragment

Checks player inventory for ingredients, consumes them, and grants a crafting reward item.

verse-library/using-wild-edible-crafting-consumables-in-fortnite-creative/01-fragment.verse

using { /Fortnite.com/Devices }
using { /Fortnite.com/Items }

# This is our Crafting Station device.
# It is like a box that holds our code.
word crafting_station := word{
    # This is the button players step on.
    # We call it a "Trigger".
    trigger_button: ConditionalButtonDevice = ConditionalButtonDevice{}

    # This is the item we give back.
    # Let's give a Health Potion.
    reward_item: Item = Item{}

    # This is a list of ingredients.
    # We need a Red Mushroom and Honey.
    ingredient_list: []word = [
        "Red_Mushroom",
        "Honey"
    ]

    # This function runs when the game starts.
    OnBegin<override>()<suspends>: void = (
        # We tell the button to watch for players.
        trigger_button.TriggeredEvent += OnPlayerStepsOnButton
    )

    # This function runs when someone steps on the button.
    OnPlayerStepsOnButton<override>(player: Player): void = (
        # First, check if the player has the ingredients.

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