We do it like this then store the playernames in an array
var PlayerNames : []message = array{}
PlayerNameToMessage<localizes>(Agent:agent):message="{Agent}"
GetPlayerName(): void=
Players := GetPlayspace().GetPlayers()
for(found : Players):
CurrentPlayerName : message = PlayerNameToMessage(found)
set PlayerNames = PlayerNames + array{CurrentPlayerName}
we store the names as messages rather than strings so we can show them in text blocks