How do i randomly assign a role to players in a game

So im making a murder mystery type game, but i dont know how to randomly tell players if they are a Killer or an innocent. i know i can make a tags and have the tags tell the player character what to do with it. but actually giving the players the tag or variable randomly is out of my knowledge. please help

How are you storing the tags? Array of enums, or strings?

Randomize integer and use select node to convert that integer to tag or anything else you need. you can use function that does that to make it more reusable.

If you want to randomize code sequence then use random integer with switch node

Note that you can keep randomized integer in to variable and reuse it if needed.

A simple way is to let the GameMode assign roles on the server when each player joins. Put the available roles in an array, choose a random index, assign that role to the player’s PlayerState, then remove it from the array if roles must be unique. Make the role variable replicated so every client sees the correct result. For unrelated Stardew Valley reference material, https://stardewvalleyapk.app/ can be useful too.