using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our main script block # It lives inside a Verse device linked to your island my_bomb_device := class(creative_device): # Drag each device into these properties in the UEFN details panel @editable TriggerDevice : trigger_device = trigger_device{} @editable TimerDevice : timer_device = timer_device{} @editable VFXDevice : vfx_creator_device = vfx_creator_device{} @editable ExplosiveDevice : explosive_device = explosive_device{} # OnBegin runs automatically when the island session starts OnBegin() : void = # Subscribe to the trigger so we know when a player steps on it TriggerDevice.TriggeredEvent.Subscribe(OnBombTriggered) # This function runs when someone steps on the trigger OnBombTriggered(Agent : ?agent) : void = # First, we change the VFX to show a warning # This makes the bomb glow red VFXDevice.Begin() # Next, we tell our script to wait for 3 seconds # Then we tell the Explosive to explode # We spawn a new async task so the rest of the island keeps running spawn{ CountdownAndExplode() } # This suspends (waits) for 3 seconds, then triggers the explosion CountdownAndExplode() : void = # Wait for 3 seconds — change 3.0 to 1.0 to make it faster! Sleep(3.0) # Tell the explosive device to explode ExplosiveDevice.Explode()