# This is the main script for our island. # It connects the spawner to our light. using { /Fortnite.com/Devices } # This is our "Container" for the script. # Think of it as a box that holds our rules. actor Main is: # This is the NPC Spawner we placed in the level. # We link it here so we can use it. my_spawner: NpcSpawnerDevice = NpcSpawnerDevice{} # This is the light we want to change. my_light: Light = Light{} # This is the "signal" we listen to. # It fires when an NPC is born. OnNpcSpawned := my_spawner.SpawnedEvent # This is the main loop. # It waits for the signal to fire. on begin() is: # We wait for the SpawnedEvent signal. # When it fires, the code inside runs. for event : OnNpcSpawned do: # The NPC has spawned! # Let's turn the light green. my_light.SetColor(Color{R:0.0, G:1.0, B:0.0}) # Let's wait a moment before turning it off. Wait(2.0) # Turn the light back to white. my_light.SetColor(Color{R:1.0, G:1.0, B:1.0})