So I want to randomize what roles people get on my server, I want one person to become detective, one person to become a doctor, and the other to become a murderer, how do I make sure that one of those roles don't get assigned to the same person again?
There are many ways to do this, you could make a table of all the detectives, you could save a value inside the player to check what they were last round, you could have a simple if statement etc. What I would do involves creating a value inside the player to check what they were last round
game.Players.PlayerAdded:connect(function(player) --whenever a player joins, insert a value into them local WasLast = Instance.new("StringValue",player) WasLast.Name = "WasLast" WasLast.Value = "whatever" end)
With this value in place, you can check if the player was a certain something last round.
local function checkWasLast(player) return player:FindFirstChild("WasLast").Vaue --this function isn't really that useful, but I thought I'd put it in anyway end
And there you have it, simply set the value of the, ahem, value to whatever they were last, and make sure they don't become that again.