Verse Library verse

01 Device

Executes a manager function to ping all hiding props when a physical or UI button is activated.

verse-library/pingplayerprops/01-device.verse

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our Button Device. It's the trigger.
ChaosButton := class(creative_device):
    # We store a reference to the Prop-O-Matic manager device here.
    # Drag your prop_o_matic_manager_device into this field in the UEFN details panel.
    @editable
    Manager : prop_o_matic_manager_device = prop_o_matic_manager_device{}

    # This is the "Init" function. It runs once when the island starts.
    # Think of this as loading your loadout before the match begins.
    OnBegin<override>()<suspends>:void=
        # We need to find the Prop O'Matic Manager in our island.
        # In the UEFN details panel, assign your prop_o_matic_manager_device to Manager above.
        # Then subscribe to whatever button/trigger fires OnActivated.
        OnActivated()

    # This is the "OnActivated" event.
    # It runs EVERY time someone presses the button.
    # Think of this like the "Elimination" event firing.
    OnActivated():void=
        # Here is the magic line.
        # We are calling the Manager's PingAllProps function.
        # It takes NO parameters because it affects EVERYONE hiding.
        Manager.PingAllProps()

        # Optional: Let's tell the player "It's on!"
        # This prints a message to the console (F8 to view).
        Print("CHAKA-CHAKA! All props revealed!")

Comments

    Sign in to vote, comment, or suggest an edit. Sign in