Verse Library verse

01 Standalone

Enables trap devices on start and activates a mover when enemies enter a trigger zone.

verse-library/enable/01-standalone.verse

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

# This is our main "Brain" entity. 
# Think of it as the game director.
RevengeTrap := class(creative_actor):
    # We need to link to our devices in the editor.
    # These are "Properties" – slots where you plug in your devices.
    TrapDoorDevice: prop_mover_device = prop_mover_device{}
    EnemyTrigger: trigger_volume_device = trigger_volume_device{}
    
    # This runs once when the game starts.
    OnBegin<override>()<sided>:void=
        # STEP 1: The "Wake Up" Call
        # We call Enable() on the Trap Door.
        # Why? Because by default, devices are disabled.
        # If we don't do this, the trap door is a ghost.
        # It won't move, even if we tell it to later.
        TrapDoorDevice.Enable()
        
        # Optional: You can also Enable the trigger if you want 
        # it to start listening immediately.
        EnemyTrigger.Enable()
        
    # This runs every time someone enters the trigger zone.
    # 'other' is the player who stepped on the zone.
    OnActorBeginOverlap<override>(other: actor):void=
        # Check if the person who stepped on it is an Enemy
        if other.GetTeam() != GetTeam():
            # STEP 2: The Attack

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