Verse Library verse

01 Fragment

Configures and activates a rhythmic pulse trap device that deals periodic damage.

verse-library/using-pulse-trigger-devices-in-fortnite-creative/01-fragment.verse

# PulseTrap.verse
# A Verse script that creates a rhythmic damage trap.

# Import the basic Verse framework
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main script class. Think of it as the "Brain" of the trap.
class PulseTrapScript is active_world_script():

    # VARIABLES: These are like your loadout slots.
    # We define them here so we can change them easily later.
    # A "Variable" is a container for data that can change.
    
    # This variable holds the Pulse Trigger device.
    # We will assign it in the editor.
    PulseDevice: PulseTriggerDevice = PulseTriggerDevice()
    
    # This variable holds the damage amount.
    # A "Constant" is a variable that never changes once set.
    # Here, we use a variable so we can tweak it.
    DamageAmount: int = 25
    
    # This is a FUNCTION. A function is a block of code that does a specific job.
    # Think of it like a "Healing Item" - you use it, and it restores health.
    # Here, our function "ActivatesPulse" will send the signal.
    OnActivatePulse() -> void:
        # This line tells the Pulse Trigger to start sending pulses.
        # It's like pressing the "Fire" button on a weapon.
        PulseDevice.SetBPM(120) # Set to 120 BPM for fast pulses

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