Question about Player Spawner Device

I think I’ve solved it. Adding a player_spawner_device array. I did this (could not be the best way to do it, but it worked):

@editable
    LevelSpawnNivel1 : []player_spawner_device = array{}

@editable
    LevelSpawnNivel2 : []player_spawner_device = array{}

@editable
    Teleports : []teleporter_device = array{}

var CurrentSpawnerIndex: int = 0

OnBegin<override>()<suspends>:void=
    for (Spawner : LevelSpawnNivel1):
        Spawner.SpawnedEvent.Subscribe(OnPlayerSpawnedNivel1)

    for (Spawner : LevelSpawnNivel2):
        Spawner.SpawnedEvent.Subscribe(OnPlayerSpawnedNivel2)


OnPlayerSpawnedNivel1(Agent: agent): void=
        set CurrentSpawnerIndex = 1
        CompareAndTeleport(Agent)

OnPlayerSpawnedNivel2(Agent: agent): void=
        set CurrentSpawnerIndex = 2
        CompareAndTeleport(Agent)

CompareAndTeleport(Agent: agent): void=
        if (PlayerObj := player[Agent]):
            if (AgentStats := AllPlayersMap[PlayerObj]):
                var NivelJugador: int = AgentStats.NivelActual
               
                if (NivelJugador < CurrentSpawnerIndex):
                    if (Teleport := Teleports[NivelJugador])
                        Teleport.Teleport(PlayerObj)

Actually, no need to do it with level 1 cuz is the lowest level, so nothing changes. It worked rn, so Idk if it will work on private island yet. Thank you for helping me!