# Import the necessary modules # Think of these as the "Loadout" for our script. # We need the core Verse library and the Video Player device definitions. use core:/engine/core.verse use video_player:/engine/video_player.verse # Define our Script # This is the "Player Spawner" for our logic. # It binds our code to the devices we place in the editor. script MusicVideoClub <| # The Switch Device # This is like the "Trigger" in a trap. # It waits for a signal. switch_device: SwitchDevice = SwitchDevice{} # The Video Player Device # This is the "Prop Mover" but for media. # It holds the video stream. video_player: VideoPlayerDevice = VideoPlayerDevice{} # The "On Switch Flipped" Event # This is the "Elimination Event" for our logic. # It fires when the switch is activated. on_switch_flipped() =| # Check if the video is currently playing # If it is, stop it. If not, play it. # This is like checking if the Storm is active before turning it on. if video_player:is_playing() =| # Stop the video video_player:stop() else =| # Start the video # We assume the video ID is set in the device settings in UEFN video_player:play() | |> # Bind the event to the switch # This connects the "Trigger" to the "Code". # When the switch sends a signal, run on_switch_flipped. bind switch_device:activated_event to on_switch_flipped() |>