# Import the necessary Fortnite frameworks using { /Fortnite.com/Devices } using { /Verse.org/Sim } # This is our "Main" script. It runs when the game starts. # Think of it as the "Game Start" event in the device editor. script() = # We need to find our devices in the world. # In Verse, we use 'Get' to grab a reference to a device by its name. # If you named your controller "MyStormController" in the editor, use that name. storm_controller := Get("MyStormController") trigger_zone := Get("MyTriggerZone") # This function runs when the game starts OnStart() = # Print a message to the debug console (F8 in-game) Print("Storm is ready. Enter the zone to shrink it!") # This function runs when an agent (player) enters the trigger zone OnBeginPlay() = # Subscribe to the 'OnEnter' event of the trigger zone. # This is like saying: "When someone steps here, run this code." trigger_zone.OnEnter.Subscribe(OnPlayerEnter) # This is the function that runs when a player enters the zone OnPlayerEnter(entering_agent: Agent) = # Check if the thing entering is actually a player (agent) if entering_agent.IsAgent(): # Signal the storm controller to advance to the next phase. # This is the "Variable" changing: Phase 1 -> Phase 2. # We use the 'Signal' method to tell the device what to do. storm_controller.SignalNextPhase() # Optional: Play a sound or spawn particles here! Print("Storm phase advanced! Good luck.")