Verse Library verse

01 Device

Grants items via a volume trigger only when a player enters the area.

verse-library/isofclass/01-device.verse

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

# This is our VIP Lounge Script.
# It listens to the Trigger and only gives loot to Players.
VIP_Lounge := class(creative_device):
    # We need a reference to the Trigger Volume we placed in the editor.
    # Think of this as the "Door Sensor."
    @editable
    Trigger : trigger_device = trigger_device{}

    # We need a reference to the Item Granter.
    # Think of this as the "Loot Dispenser."
    @editable
    Dispenser : item_granter_device = item_granter_device{}

    # This function runs when the game starts.
    # It sets up the connections.
    OnBegin<override>()<suspends>:void=
        # We want to listen for when the Trigger is "Activated" (someone enters).
        # Trigger.TriggeredEvent is an Event. It's like a bell that rings.
        # We attach our function to that bell.
        Trigger.TriggeredEvent.Subscribe(OnTriggerActivated)
        
        # Keep the script alive so it keeps listening.
        loop:
            Sleep(0.0)

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