Verse Library verse

01 Fragment

Manages match lifecycle by updating UI text and executing setup logic when rounds begin or conclude.

verse-library/subscriberoundstarted/01-fragment.verse

using { /Fortnite.com/Game }

# This is our main script. Think of it as the "Brain" of our island.
script MatchStatusController: VerseScript()
    # We need a reference to our Text Prop so we can change its text.
    # In Verse, we bind this in the editor, but for this example, 
    # we'll assume we have a way to access it. 
    # Note: In a real script, you'd typically get the entity by name or reference.
    StatusTextProp: TextProp = TextProp{}

    # This function runs when the round STARTS.
    # It's our "Callback" - the promise we made to the game engine.
    OnRoundStart(): void =
        # Change the text to show the match has begun.
        StatusTextProp.SetText("MATCH STARTED!")
        # You could also play a sound, spawn loot, etc. here.
        print("Round has started! The game is live.")

    # This function runs when the round ENDS.
    OnRoundEnd(): void =
        # Change the text to show the match is over.
        StatusTextProp.SetText("MATCH OVER")
        print("Round has ended. Cleaning up...")

    # This is where we set up our subscriptions.
    # It runs once when the script initializes.
    OnBeginScript(): void =
        # First, we need to find the Round Manager.
        # Think of this as finding the "Referee" of the match.
        if (RoundManager := Entity.GetFortRoundManager[]):

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