To get the team’s total score, you’ll want to add up the scores of each player on the team, like @winterdreams suggested.
This is because you are trying to read the value again but not within a failable context, i.e. GetTeamScore[0]
doesn’t guarantee a value will return so you need to handle that possibility. Failure documentation link. You’re already handling it on the line before, and what you will want is to store the value you read back from GetTeamScore
before using it:
GameLoop()<suspends> :void=
loop:
if (Score:int = GetTeamScore[0]):
Print("Player Score: {Score}")
You probably don’t want to do this every update tick though, and can use the ScoreOutputEvent
like in the OP.