# We are bringing in the necessary device types from Fortnite's library. # Think of this like loading the ammo before a fight. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } # This is our main script. It's a creative_device, the standard base class # for any Verse script you attach to a device on your island. chaos_zone_manager := class(creative_device): # These @editable fields are the bridge between code and editor. # Drag your ChaosButton device into this slot in the Details panel. @editable ChaosButton : button_device = button_device{} # Drag your BurnZone Fire Volume device into this slot. @editable BurnZone : fire_volume_device = fire_volume_device{} # Track whether fire is currently active in the zone. # We start it as false — the zone begins safe. var FireIsOn : logic = false # OnBegin runs once when the game starts. # We use this to set the initial state and wire up the button event. OnBegin() : void = # Start with fire OFF in the zone. # It's like telling the bouncer: "Nobody lights matches today." BurnZone.Disable() # Print a message to the debug log so we know it worked. # Think of this as a whisper to yourself. Print("Zone is safe. No fires allowed.") # Subscribe to the button's InteractedWithEvent. # 'Agent' is whoever pressed the button — we don't use it here, # but the event signature requires it. ChaosButton.InteractedWithEvent.Subscribe(OnChaosButtonPressed) # This function runs every time a player presses ChaosButton. # The agent parameter tells us who triggered it (required by the event). OnChaosButtonPressed(Agent : agent) : void = # Toggle the tracked state and apply it to the volume. if (FireIsOn?): # Fire was ON — turn it OFF. set FireIsOn = false BurnZone.Disable() Print("Fire turned OFF. Stay cool.") else: # Fire was OFF — turn it ON. set FireIsOn = true BurnZone.Enable() Print("Fire turned ON. Burn baby burn.")