# This is our main script file. # It connects the Trigger to the Light. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } # This is our "CampfireScript". # It is a container for our code. CampfireScript := class(creative_device): # This is the "Trigger" device. # We link it in the editor later. @editable MyTrigger: trigger_device = trigger_device{} # This is the "Light" device on the campfire. # We link it in the editor later. # note: customizable_light_device is the real UEFN light device type. @editable CampfireLight: customizable_light_device = customizable_light_device{} # This function runs when the game starts. OnBegin():void= # We tell the trigger to listen for players. # "TriggeredEvent" fires when someone walks in. MyTrigger.TriggeredEvent.Subscribe(OnPlayerEntered) # This function runs when the event happens. # "Agent" is the person who walked in. OnPlayerEntered(Agent: ?agent):void= # Turn on the campfire light! CampfireLight.TurnOn() # Print a message to help us debug. Print("You found the secret campfire!")