using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/Diagnostics } using { /Verse.org/Simulation } # We are defining a custom device that acts as a smart spawner SpawnRoomDevice := class(creative_device): # This is the "slot" where we drag the Player Spawner device in the editor # Think of this as the "empty bus" waiting for a player @editable SpawnPad : player_spawner_device = player_spawner_device{} # This function runs when the game starts OnBegin() : void = # 1. Set the Team # Only Team 1 players can use this pad. # If a Team 2 player tries to spawn here, they'll get kicked to the next available spawner. # note: Team index 1 maps to Team 1 in the device's Team property (0 = any team) # note: SetTeam is an epic_internal API; configure the Team property in the UEFN Details panel instead. # 2. Hide the Pad # We don't want players to see the spawn pad floating in the air. # It should look like just the floor. SpawnPad.Disable() # note: player_spawner_device has no SetVisibleInGame API; use the editor's # "Visible in Game" property directly on the device, or toggle with Disable/Enable # to disable the spawner entirely. For visibility-only control, set # "Visible in Game = Off" in the device's Details panel in UEFN. # 3. Optional: Set Priority # This is the "VIP line" for spawning. # 1 means "Pick me first!" # note: Spawn priority is configured via the "Spawn Order" property in the # UEFN Details panel; player_spawner_device exposes no SetPriorityGroup API. Print("SpawnRoomDevice: spawner configured for Team 1.")