Verse Libraryverse

01 Snippet

Periodically grants a randomly selected item to all active players using a timer device and an item granter.

extracted-snippets/community/learning/tutorials/4lbE/fortnite-pillars-random-items-verse/01-snippet.verse

# Source URL: https://dev.epicgames.com/community/learning/tutorials/4lbE/fortnite-pillars-random-items-verse
# Local doc:  verse-cortex-epic-docs/community/learning/tutorials/4lbE/fortnite-pillars-random-items-verse.md
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Random }


RandomItems := class(creative_device):

    @editable Items : item_granter_device = item_granter_device{}

    @editable Timer : timer_device = timer_device{}

    @editable Cantidad_Items : int = 10

   
    OnBegin<override>()<suspends>:void=

       Eventos()


    Eventos():void=

        Timer.SuccessEvent.Subscribe(TimerEvent)


    TimerEvent(A : ?agent):void=

        AllPlayers := GetPlayspace().GetParticipants()

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