using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } using { /UnrealEngine.com/Temporary/SpatialMath } using { /Verse.org/Verse } using { /Fortnite.com/Game } using { /Fortnite.com/Characters } using { /Fortnite.com/FortPlayerUtilities } # See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device. team_spawn_location := class(): @editable SpawnLocations: []creative_prop = array{} # A Verse-authored creative device that can be placed in a level respawn_players_device := class(creative_device): @editable TeamsSpawnLocations: []team_spawn_location = array{} @editable SpawnTrigger: trigger_device = trigger_device{} # Runs when the device is started in a running game OnBegin():void= SpawnTrigger.TriggeredEvent.Subscribe(SpawnPlayers) SpawnPlayers(MaybeAgent: ?agent): void = for (Idx -> Team: GetPlayspace().GetTeamCollection().GetTeams(), SpawnLocations := TeamsSpawnLocations[Idx].SpawnLocations): Print("Team") var PadIdx: int = 0 for (Agent: GetPlayspace().GetTeamCollection().GetAgents[Team], not Agent.GetFortCharacter[].IsActive[], Pad := SpawnLocations[PadIdx]): Print("Respawning") Agent.Respawn(Pad.GetTransform().Translation, Pad.GetTransform().Rotation) set PadIdx += 1