Editable Array not keeping the same length

Hello, I have a very strange issue. I have an editable array of 4 Player Reference Devices, and a function with a for loop that goes through them. When I call the function with the player walking on a Trigger Device, everything works fine and the Array’s Length gets printed out as 4, which is correct. However, when I activate the function through the Trigger’s TriggeredEvent (Through Verse) , it runs the function but the for loop does not get run because the Length is printed out as 0! In the same game session I can switch between these two methods of calling the function and it is printing two different lengths of the same array at different times? The array is not being changed at runtime. Here is my code, any help greatly appreciated!

OnTrigger(Agent: agent): void =
     Print("PRs:{PlayerReferences.Length}")
                for(Index -> PR : PlayerReferences):
                    if(PR.IsReferenced[Agent]):
                        Print("Ref Found at {Index}")
                    else Print("No Match at {Index}")

can you show the how the @editable array is done also since when do triggers not pass an optional agent? can you show a bit more of the code?

The Trigger is subscribed to another function that just does casting and gets player stats as this script has to do with persistent stats tracking kills, here is more of the code but I have debugged every line of these so far, the problem is the for statement above not running at all because length of array comes back as 0 when AddKill is called through Verse when a creature is killed. The stats get recorded, but the player reference doesn’t get found and thus I can’t update the matching billboard, which is my goal. Right now when I get kills they get tracked but the PlayerReferences array comes back empty, and then when I run over the Trigger the PlayerReferences suddenly prints length of 4 and the billboard updates to the correct number of kills.

@editable StatsBillboards: []billboard_device = array{}
@editable PlayerReferences: []player_reference_device = array{}
@editable KillsTrigger : trigger_device = trigger_device{}

 OnBegin<override>()<suspends>: void = 
        KillsTrigger.TriggeredEvent.Subscribe(AddKill)

    AddKill(Agent: ?agent): void =
        if:
            ValidAgent := Agent?
            CurrentPlayerStats := PlayerStatsManager.GetPlayerStats[ValidAgent]
            CurrentScore := CurrentPlayerStats.Score.CurrentValue
        then:
            Print("Kill Recorded")
            #This prints every kill so is working
            PlayerStatsManager.RecordPlayerStat(ValidAgent, StatType.Score, ?Score := CurrentScore +1)
            OnTrigger(ValidAgent)

OnTrigger(Agent: agent): void =
     Print("PRs:{PlayerReferences.Length}")
                for(Index -> PR : PlayerReferences):
                    if(PR.IsReferenced[Agent]):
                        Print("Ref Found at {Index}")
                            if(Billboard := StatsBillboards[Index]):
                                Billboard.SetText(StatsMessage(Kills:= CurrentPlayerStats.Score.CurrentValue))
                                Billboard.UpdateDisplay
                                Print("Billboard {Index} Updated")
                    else Print("No Match at {Index}")

Thanks so much for taking a look at this, not sure if I have some sort of syntax error but if you can’t figure it out I’ll try in an empty project to see if this is a bug!