Random character role picker!

how can I make a random character selector as among us for IMPOSTOR and CREWMATES, each player to have his own role and not be repeated to someone else

I also need an answer for this! please provide solutions, I can’t seem to find the solution

Based on the same case as Among Us I would do it this way.

I would create a function getRole which would return IMPOSTOR or CREWMATE, inside the function I would check a boolean variable imposterExists, if it’s true I would return “CREWMATE” directly as it can be only 1 imposter. If you need more imposters than 1 instead of boolean make it an integer and increment it every time the role is assigned and check if the max number of imposters have been given.

If that part is not executed I would have an array with 2 elements, CREWMATE and IMPOSTOR, get a random element and return it. Don’t forget to either set imposterExists to true if the returned element is IMPOSTOR or increment the value if you went with multiple impostors.