# This is our main script file. # It runs when the island starts. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # We define our devices here. # Think of these as names for our tools. hero_zone_manager := class(creative_device): # These properties are set in the UEFN editor. # Drag your placed devices into these slots. @editable MyTrigger : trigger_device = trigger_device{} @editable MyGlow : vfx_powerup_device = vfx_powerup_device{} # This function runs when the game starts. OnBegin() : void = # We listen for players entering the trigger. # OnTriggered fires when any agent activates the trigger. MyTrigger.TriggeredEvent.Subscribe(OnPlayerEnteredTrigger) # This handler runs each time the trigger fires. OnPlayerEnteredTrigger(Agent : agent) : void = # Cast the agent to a fort_character so we can apply the effect. if (Player := Agent.GetFortCharacter[]): # Activate the glow on the player who entered. # Color and duration are configured on the device in the editor. # note: vfx_powerup_device does not expose a runtime SetColor API; # set the color and duration in the device's property panel. MyGlow.Activate(Agent)