# This script fades out music when a player enters a zone. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Simulation/Tags } # This is our main device class. # Place it in the editor like any other device. BossFightScript := class(creative_device): # This is the trigger volume we placed in the editor. # Drag your Trigger Volume device into this slot in the editor. @editable TriggerVolume : trigger_device = trigger_device{} # This is the Audio Mixer device. # Drag your Audio Mixer device into this slot in the editor. @editable AudioMixer : audio_mixer_device = audio_mixer_device{} # note: audio_mixer_device manages sound buses via control bus mixes. # Use ActivateMix/DeactivateMix to switch between mix presets configured # in the editor. Volume changes must be wired via the Audio Mixer device's # mix settings in the editor (e.g., set the mix to reduce music bus volume). # This runs once when the game starts. OnBegin() : void = # Connect the trigger to our function. # When someone enters, run 'OnPlayerEnter'. TriggerVolume.TriggeredEvent.Subscribe(OnPlayerEnter) # This function runs when a player enters the trigger. # trigger_device events pass an optional agent, so we accept ?agent. OnPlayerEnter(Agent : ?agent) : void = # Activate the mix configured on the Audio Mixer device. # Set up your mix in the editor to lower the Music bus volume to ~20%. AudioMixer.ActivateMix() # note: To control a separate Effects bus, add a second # @editable audio_mixer_device for your effects mix and # call ActivateMix on that reference instead.