Verse Library verse

01 Standalone

Spawns a configurable crowd of NPCs via a volume device when a player enters a trigger zone.

verse-library/using-crowd-volume-devices-in-fortnite-creative/01-standalone.verse

using { /Fortnite.com/Devices }

# This is our main script object. Think of it as the "Game Rules" folder.
MyStageScript := class(creative_object):

    # Here we define our "variables" (the things that change).
    # is_stage_active is a boolean (True/False), like a light switch.
    is_stage_active := false

    # We reference our devices by name. 
    # Make sure the names in the editor match these exactly!
    stage_trigger := VolumeDevice:StageTrigger
    crowd_volume := CrowdVolumeDevice:CheeringCrowd

    # This function runs when the script starts.
    OnBegin<override>()<suspends>: void=
        # We connect the "Player Entered" event of the trigger
        # to our custom function below.
        # Think of this as plugging a wire from the trigger to the speaker.
        stage_trigger.PlayerEntered += OnPlayerEnterStage

        # We also connect the "Player Left" event.
        stage_trigger.PlayerLeft += OnPlayerLeaveStage

    # This function runs when a player walks into the trigger volume.
    OnPlayerEnterStage(player: player): void=
        # Set the variable to true (switch ON)
        is_stage_active = true
        
        # Set the number of NPCs to spawn.

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