Verse Library verse

01 Fragment

Simple script that tracks and prints a player score each time a fish is caught during gameplay.

verse-library/using-fishing-zone-devices-in-fortnite-creative/01-fragment.verse

# This is our Verse script
using { /Fortnite.com/Devices }

# We create a variable for the score
# It starts at zero
Score : int = 0

# This function runs when the game starts
OnBegin<override>()<suspends>: void=
    # We print a message to the console
    # This helps us know the code is working
    print("Fishing game started!")

# This function runs when you catch a fish
# The zone calls this function
OnFishCaught(player: player, fish: item): void=
    # We add 1 to the score
    Score = Score + 1
    
    # We print the new score
    print("You caught a fish! Score is: ", Score)
    
    # You can add more code here later
    # Like playing a sound or showing text

Comments

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