# 1. IMPORT THE TOOLS # We need the Devices module to control things like lights and sound emitters. # Without this line, Verse won't know what a 'customizable_light_device' or # 'audio_player_device' is. using { /Fortnite.com/Devices } # We also need the core module for suspends and basic language features. using { /Verse.org/Simulation } # 2. DEFINE THE CLASS (The 'Island' object) # Every Verse script that runs in UEFN is a class that extends creative_device. # This is the real base type for all Verse-driven devices in Fortnite. revenge_trap_script := class(creative_device): # 3. DEFINE THE VARIABLES (The Loot Slots) # These are properties we can assign in the UEFN Details panel. # '@editable' exposes the variable so we can drag devices into it in the editor. @editable MyLight : customizable_light_device = customizable_light_device{} @editable MySound : audio_player_device = audio_player_device{} # 4. DEFINE THE EVENT (The Trigger) # OnBegin() runs automatically when the island starts. # '' means we are replacing the default empty version from creative_device. # '' means this function can pause and wait (needed for await). OnBegin() : void = # Turn the light ON. # Enable() is the real method on customizable_light_device. MyLight.Enable() # Play the sound once. # Play() is the real method on audio_player_device. MySound.Play()