Like im murder mystery, Possesion the way it picks Innocent,Sherrif,Murder -In murder myster- Ghost,Human -In possesion-
You can hide the team gui (leaderboard) with:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
We need to assign 3 teams: Innocent, Sherrif, Murder. We know that:
So, the best approach is to assign Sherrif and Murderer first and then assign everyone else to Innocent.
function ReOrganizeTeams() if #game.Players:GetPlayers() <= 3 then print("Not enough players") return end local function random_index(tab) return math.random(1, #tab) end local players = game.Players:GetPlayers() local murderer = random_index(players) players[murderer].TeamColor = BrickColor.Red() -- The murder team color --remove the murderer from the table table.remove(players, murderer) local sherrif = random_index(players) players[sherrif].TeamColor = BrickColor.Blue() -- sheriff team color -- also remove the sheriff table.remove(players, sherrif) for _, player in pairs(players) do player.TeamColor = BrickColor.Green() -- for everyone else assign innocent team color end