Verse Library verse

01 Fragment

Triggers a welcome message in player HUD when entering a designated zone for lobby greetings.

verse-library/using-western-galleries-in-fortnite-creative/01-fragment.verse

# Import the necessary Verse libraries
using /Fortnite.com/Devices
using /Verse.org/Simulate
using /UnrealEngine.com/Temporary/SlateUI

# Define our Main Script
CreateSaloonWelcome = script(
    # This is a 'Variable'. Think of it as a label on a box.
    # We will store our Trigger device here.
    TriggerDevice: TriggerDevice = script()
)

# This is a 'Function'. Think of it as a recipe or a sequence of steps.
# It only runs when called.
OnBegin<override>()<suspends>: void = {
    # 'OnBegin' is an 'Event'. It’s like the Battle Bus door opening.
    # It happens automatically when the island starts.
    
    # We connect our TriggerDevice to a 'Function' called WhenPlayerEnters.
    # This is called 'Binding'. It’s like setting a trap: 
    # "If player steps here, DO THIS."
    TriggerDevice.WhenPlayerEntered.Bind(
        func(Player: Player): void {
            # This inner function runs when the event triggers.
            
            # 'PrintToScreen' is an API call. 
            # Think of it as the player getting a text message in their HUD.
            Player.PrintToScreen("Welcome to the Saloon! Watch your back.")
            
            # Optional: Play a sound if you have an Audio Device linked

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