# This is a simple Verse script for a spawn pad. # It runs when a player starts the game. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is a Device. It is a game object. # We attach this script to a Player Spawn Pad. spawn_pad_device := class(creative_device): # Reference to the player_spawner_device placed in the scene. # Assign this in the UEFN details panel. @editable SpawnPad : player_spawner_device = player_spawner_device{} # This function runs when the game starts. OnBegin() : void = # Tell the device to wait for players. # It will trigger when someone steps on it. SpawnPad.SpawnedEvent.Subscribe(SpawnPlayerHandler) # This is a handler. It reacts to events. # note: SpawnedEvent sends an `agent` argument via its subscribe callback. SpawnPlayerHandler(Agent : agent) : void = # Give the player a weapon. # This makes the game fun immediately. # note: Verse has no direct Give_Weapon API; item_granter_device # is the real device used to grant items to players at runtime. if (Fort := Agent.GetFortCharacter[]): Fort.Show() # Confirm the character is active on spawn.