Verse Library verse

01 Fragment

Fires a prop mover upon player entry with a cooldown state to prevent rapid re-triggering.

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

# We are defining a "Script" which is a container for our game logic.
# Think of this like a blueprint for a specific device.
script BarnTrapScript is scriptable
    # This is the "Scene Graph" connection.
    # We need to tell the script which specific devices to control.
    # 'trigger' is the name of the variable we'll use in the Outliner.
    trigger: Trigger Volume = Trigger Volume'None'
    # 'launcher' is the Prop Mover device.
    launcher: Prop Mover = Prop Mover'None'
    
    # This is a Variable. 
    # It stores a boolean (true/false) value.
    # Think of it like a "Cooldown" timer that is either ON or OFF.
    is_cooldown: bool = false
    
    # This is an Event. 
    # Events are like "listening devices." 
    # The game calls this function when the condition is met.
    @event
    OnPlayerEnter(trigger: Trigger Volume, player: Player) is server
        # Check if the cooldown is active.
        # If is_cooldown is true, we ignore the player.
        if is_cooldown == true
            return # Stop the function here.
        
        # If we are here, the trap is ready to fire.
        # 1. Set the cooldown to true (so it doesn't fire again immediately).
        is_cooldown = true
        
        # 2. Activate the Prop Mover.

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