Verse Library verse

01 Device

Triggers automatic loot drops when enemies are defeated, streamlining reward distribution for combat focused gameplay.

verse-library/using-elimination-manager-devices-in-fortnite-creative/01-device.verse

# This is the main script for our loot drop
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We define a new type called "LootDropDevice"
# Think of this as a blueprint for our device
LootDropDevice := class(creative_device) {

    # This is a "variable". It holds the manager device.
    # A variable is like a box that can change.
    # You connect this to your Elimination Manager in the editor.
    @editable
    Manager : elimination_manager_device = elimination_manager_device{}

    # This is a "function". It is a set of instructions.
    # We call it when the game starts.
    OnBegin<override>()<suspends> : void = {
        Print("Loot system is ready!")

        # We subscribe to the EliminatedEvent so we know
        # when any tracked target is defeated.
        # # note: elimination_manager_device exposes EliminatedEvent
        # which fires with an elimination_result value.
        Manager.EliminatedEvent.Await()
        OnTargetEliminated()
    }

    # This function runs when an elimination happens.
    OnTargetEliminated() : void = {

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