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():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(other: actor):void= # Check if the person who stepped on it is an Enemy if other.GetTeam() != GetTeam(): # STEP 2: The Attack # Now that the trap door is Enabled, we can Activate it. # Activate tells the device to perform its action (Open/Close). TrapDoorDevice.Activate() # Optional: Disable it after 5 seconds so it resets? # That's a challenge for later!