# This is the main script for our secret weapon.
# It runs when the island starts.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We create a new object called SecretWeapon.
# This object holds our logic.
SecretWeapon := class(creative_device):
# This is the Item Placer device.
# We will connect it later in the editor.
@editable
my_placer : item_spawner_device = item_spawner_device{}
# This is the function that runs first.
# It sets up the game.
OnBegin<override>()<suspends> : void =
# We wait for a player to interact.
# When they touch the placer, this runs.
my_placer.ItemPickedUpEvent.Subscribe(OnItemPickedUp)
# This function runs when a player picks up the item.
OnItemPickedUp(Agent : agent) : void =
# We start a background task.
# It will wait 5 seconds and then reset the placer.
spawn{ ResetAfterDelay() }
# This is the function that waits, then resets.
Verse Library
verse
01 Device
Respawns placed items after a timed delay when players pick them up, managing pickup events.
verse-library/using-item-placer-devices-in-fortnite-creative/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.