using { /Fortnite.com/Devices } using { /Fortnite.com/Devices/Patchwork } using { /Verse.org/Simulation } # This is our brain. It controls the trap. # We name it 'MusicalLightTrap'. MusicalLightTrap := class(creative_device): # This is the Note Trigger device. # It waits for a player to step on it. @editable NoteTrigger : note_trigger_device = note_trigger_device{} # This is the light we want to turn on. @editable MyLight : customizable_light_device = customizable_light_device{} # This runs when the game starts. OnBegin() : void = # Print a message to check if it works. Print("The trap is ready!") # Wait for the trigger signal. # This line waits forever until the note triggers. # note: TriggeredEvent fires when the note_trigger_device activates. NoteTrigger.TriggeredEvent.Await() # Once triggered, turn on the light! MyLight.TurnOn() # Print a message to say it worked. Print("Light is ON!")