# This is a Verse Device. It lives in your island. # It watches for the player to push the box. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /UnrealEngine.com/Temporary/SpatialMath } using { /Verse.org/Simulation } puzzle_manager := class(creative_device): # Wire these devices up in the editor's Details panel. # Select this device, then drag the matching object into each slot. # This is the trigger_device placed on the target zone. @editable PushTrigger : trigger_device = trigger_device{} # This is the customizable_light_device placed above the target. @editable TargetLight : customizable_light_device = customizable_light_device{} # This script runs when the device starts. OnBegin(): void = # Subscribe to the trigger's agent-entered event. # TriggeredEvent fires when an agent (player) activates the trigger. PushTrigger.TriggeredEvent.Subscribe(OnTriggerActivated) # Keep the device running so events keep firing. Sleep(Inf) # This function runs when the trigger is activated. OnTriggerActivated(Agent : ?agent): void = # Turn on the light! TargetLight.TurnOn() # You could also play a sound here.