Map array cause Error on my verse code

Hi,
Let me ask Error causing map array on my verse code.
Refering to
4. Tracking Players Using Maps | Epic Developer Community (epicgames.com)

I implement the following code:

PlayerScore : [player]int = map{}
    
    var AgentScore : int = 0
    OnBegin<override>()<suspends>:void=
        Playspace: fort_playspace = GetPlayspace()
        var AllPlayers: []player = Playspace.GetPlayers()
        for (Agent : AllPlayers, TeamPlayer := player[Agent], FortCharacter := TeamPlayer.GetFortCharacter[]):
            if(set PlayerScore[TeamPlayer] = 0, WeaponTier := PlayerScore[TeamPlayer]):

However, on my code, Error as the attached picture occur.
I cannot find what is difference between my verse code and official document.
Could you give me some hints?

Regards

PlayerScore map does not have var written before it

1 Like

Thank you very much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.