Verse Library verse

01 Fragment

Displays a custom chat message whenever a player enters a specific trigger zone.

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

# This is a comment. It's like a developer's sticky note.
# The game ignores this, but you need it to stay sane.

# 1. DEFINE THE EVENT
# We need to know WHEN something happens.
# In this case, we want to know when a player enters a specific zone.
# We'll call this event "On_Player_Enters_Zone".

On_Player_Enters_Zone: event (Source: Entity, Other: Entity) =
{
    # 2. DEFINE VARIABLES
    # A variable is like a loot box that can hold different items.
    # Here, we are creating a variable called "player_name"
    # to store the name of the player who walked in.
    player_name := Other.Get_Display_Name()

    # 3. EXECUTE ACTIONS (The "Function")
    # Now we tell the game what to DO.
    # We use "Print_To_All" to show a message in the chat.
    # Think of this like the "Elimination Feed" but for custom messages.
    Print_To_All("Spooky! {player_name} just entered the haunted hallway!")

    # We could also change the color of a wall here,
    # but let's keep it simple for now.
}

# 4. CONNECT THE EVENT TO THE DEVICE
# This part is crucial. We have defined what happens,
# but we haven't told the Trigger device to use it.
# In the UEFN editor, you will drag this script onto a Trigger device

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