# 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.
# '<override>' means we are replacing the default empty version from creative_device.
# '<suspends>' means this function can pause and wait (needed for await).
OnBegin<override>()<suspends> : void =
# Turn the light ON.
# Enable() is the real method on customizable_light_device.
Verse Library
verse
01 Device
Defines a custom device class that initializes a light and audio player when the island starts.
verse-library/how-to-use-verse-api-module-declarations-in-verse-uefn/01-device.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.