Verse Library verse

01 Device

Custom device that triggers item grants when players enter a specific volume.

verse-library/using-flopper-consumables-in-fortnite-creative/01-device.verse

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

# We define our own "Flopper Dispenser" device.
# Think of this as the blueprint for our Loot Box.
flopper_dispenser_device := class(creative_device):

    # VARIABLES: These are the settings you can change in the UE Editor panel.
    # This is like setting the "Damage" on a trap, but here we set which
    # item-granter device hands out the Flopper.
    # We wire a item_granter_device in the editor — it is pre-configured
    # with the Flopper type you want (e.g. Snowy Flopper).
    @editable
    FlopperGranter : item_granter_device = item_granter_device{}

    # We also need a trigger_device to detect the player walking in.
    # Wire this to your Trigger Volume in the editor.
    @editable
    EntranceTrigger : trigger_device = trigger_device{}

    # OnBegin runs once when the game session starts.
    # We use it to subscribe to the trigger's event — like plugging
    # the doorbell wire into the chime.
    OnBegin<override>()<suspends> : void =
        # Subscribe: whenever the trigger fires, call OnPlayerEntered.
        EntranceTrigger.TriggeredEvent.Subscribe(OnPlayerEntered)

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