Verse Library verse

01 Standalone

Calls a HUD message device to display a welcome notification when the game session begins.

verse-library/using-the-hud-message-device-to-talk-to-players/01-standalone.verse

# This is a simple Verse script
# It shows a message to the player

using /Fortnite.com/Devices
using /Engine/Systems

# This is the main script block
# It runs when the game starts
@editor_only
Edit := struct:
    # This connects our code to the HUD device
    # We call it 'welcome_message'
    welcome_message: HudMessageDevice = ""

    # This function runs when the game begins
    OnBegin<override>()<suspends>:
        # This line tells the device to show the message
        # The device will show it to everyone
        welcome_message.Trigger()

    # This is needed for the script to work properly
    OnEnd<override>()<suspends>:
        # Nothing to do here for now
        pass

Comments

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