Verse Library verse

01 Standalone

Awards double points to players when they step into a trigger volume while a specific island switch is activated.

verse-library/setscoreaward/01-standalone.verse

using { /Fortnite.com/Devices }
using { /Unreal.com/Devices }

# This is our main island script.
# Think of it as the "Game Director" that controls the rules.
double_trouble_island := class(verseworld):
    # --- DEVICES ---
    # These are the physical objects in your level.
    ScoreManager: ScoreManagerDevice = ScoreManagerDevice{}
    DoubleSwitch: SwitchDevice = SwitchDevice{}
    PointTrigger: TriggerVolumeDevice = TriggerVolumeDevice{}

    # --- VARIABLES ---
    # A variable is like a scoreboard that only the script can see.
    # It remembers if "Double Trouble" is currently active.
    is_double_active: bool = false

    # --- SETUP ---
    # This runs once when the game starts.
    on_begin<override>()<solved>:void=
        # Make sure the switch starts in the "Off" position.
        DoubleSwitch.SetState(false)
        
        # Connect the trigger to our "on_player_entered" function.
        # When someone steps into the trigger, run this code.
        PointTrigger.OnActorEntered += on_player_entered

    # --- THE LOGIC ---
    # This function runs every time a player steps into the trigger.
    on_player_entered := func(actor: actor):

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