# Sort Players by Role

This helper takes information from the Teams Array off of the Playflow Server Config whenever we read it to automatically place players who should be together, together!

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FkuAkgYAblsikbQMpEHjU%2Fimage.png?alt=media&#x26;token=88c96eb0-9ec5-48c9-b12a-775b906af4bf" alt=""><figcaption></figcaption></figure>

Each role will be sorted and then Player IDs will be set up so that we can sort that ourselves.&#x20;

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FpWwAmlzZjONwAjBHabtD%2Fimage.png?alt=media&#x26;token=a5fb84f3-a953-4696-b9a8-ffc6a835623e" alt=""><figcaption></figcaption></figure>

If your game design has multiple teams (as if it'd be a battle royale!) then you can do the following:

{% content-ref url="get-player-team-id" %}
[get-player-team-id](https://duel-studios.gitbook.io/playflow-cloud-for-unreal/helpers/get-player-team-id)
{% endcontent-ref %}
