Verse Library verse

02 Fragment

Displays a sequential HUD message to players instructing them to find a hidden objective.

verse-library/hud-message-device-design-example-in-fortnite-creative/02-fragment.verse

# A simpler Verse script that listens to a device
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }

# We create a script that holds a reference to a device.
# The device is the 'Trigger'.
ClueTrigger = script(
    # This is the device we want to control.
    # We will link it in the editor.
    ClueDevice: HudMessageDevice
):
    # This function runs when the script starts.
    OnBegin<override>()<suspends>: void =
        # We wait for an event.
        # Let's say a player steps on a tile.
        # We will bind this event in the editor.
        # For now, we just show a message.
        ClueDevice.SetMessage("Find the gold!")
        ClueDevice.Show()
        
        # Wait a bit.
        Wait(2.0)
        
        # Change the message.
        ClueDevice.SetMessage("Keep looking!")

Comments

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