Verse Library verse

01 Fragment

Continuously tracks player distance to a target and dynamically updates proximity-based search clues.

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

# This is our main script. It runs the game logic.
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }
using { /UnrealEngine.com/Temporary/Symbols }

# This is the TreasureHunt script.
# It controls the clues and the goal.
TreasureHunt = script():
    # This variable holds the current clue.
    # A variable is a box that can change.
    CurrentClue := "Start Searching!"

    # This function runs when the game starts.
    OnBegin<override>()<suspends>: void =
        # Pick a random number between 1 and 3.
        # This will decide which treasure spot is real.
        RandomSpot := RandInt(1, 3)
        
        # Tell the player to look for the treasure.
        # We send this message to all players.
        SendHint("Look for the treasure!")
        
        # Start watching the player's movement.
        # We do this in a loop.
        Loop():
            # Wait for the player to move.
            Wait(1.0)
            
            # Check the player's position.
            # We compare it to the random spot.

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