Verse – SyntaxError in custom_zonewars_device.verse

Summary

Hi Epic team and developer community,

I’m currently working on a Verse script to end a round when only one team remains, excluding Team 1 from being considered for victory. However, I’m encountering a persistent syntax error that blocks the logic entirely.

this is the syntaxerror:

C:/Users/proprietario/Documents/Fortnite Projects/AS_Zonewars/Content/custom_zonewars_device.verse(33,1, 33,1) : Script error 3100: vErr:S71: Expected expression, got end of line following "[]"

This is my code:

using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }

custom_zonewars_device := class(creative_device):

    @editable
    EndGameDevice : end_game_device = end_game_device{}

    @editable
    ExcludedTeamIndex : int = 1  # Esclude la squadra 1 (indice 1-based)

    OnBegin<override>()<suspends>:void =
        GetPlayspace().PlayerRemovedEvent().Subscribe(OnPlayerEliminated)

    OnPlayerEliminated(player: agent, team: Simulation.team): void = {
        var teamCollection := GetPlayspace().GetTeamCollection()
        var allTeams := teamCollection.GetTeams()
        var activeTeams:[]team = array{}
        for (teamIndex:int = 0..(allTeams.Length - 1)):
            var currentTeam := allTeams[teamIndex]
            if (teamIndex <> (ExcludedTeamIndex - 1)):
                if (agents := teamCollection.GetAgents(currentTeam)):
                    if (agents.Length > 0):
                        set activeTeams = activeTeams + array{currentTeam}
        if (activeTeams.Length = 1):
            var winningTeam := activeTeams[0]
            if (winningAgents := teamCollection.GetAgents(winningTeam)):
                if (winningAgents.Length > 0):
                    EndGameDevice.Activate(winningAgents[0])

            var teams: []Simulation.team = []
            if (game := GetFortniteCreativeGame()) {
                if (team_collection := game.Teams) {
                    teams = team_collection
                    var num_teams: int = teams.Length
                    for (team: Simulation.team in teams) {
                        var agents: []agent = []
                        if (team_agents := team.GetAgents()) {
                            agents = team_agents
                        }
                    }
                }
            }

            for (team: Simulation.team in teams) {
                var agents: []agent = []
                if (team_agents := team.GetAgents()) {
                    agents = team_agents
                }
            }

Steps to Reproduce

I wanted to create a Verse device that excludes Team 1 from the end-of-round logic, so that when only one of the remaining teams is still standing, the round ends.

Observed Result

i have a error like this C:/Users/proprietario/Documents/Fortnite Projects/AS_Zonewars/Content/custom_zonewars_device.verse(33,1, 33,1) : Script error 3100: vErr:S71: Expected expression, got end of line following “[]”

Platform(s)

pc, uefn, fortnite creative

Upload an image

Additional Notes

I need help as soon as possibile, thanks