I have tried to do it in the following script, but it isn't really random, as I just take random players. What is the best way to assign random roles to the players?
local Players = game:GetService("Players")
local Roles = game.ReplicatedStorage.roles:GetChildren()
local Playerstable = game.Players:GetPlayers()
Villagers = {}
Werewolves ={}
Arsonists = {}
Hunters ={}
Mediums ={}
Seers ={}
Jesters ={}
Witches ={}
function Randomizeplayer()
local Randomplayer = Players:GetChildren()[math.random(1,#Players:GetChildren())]
print(Randomplayer)
if table.getn(Werewolves) < 3
then
table.insert(Werewolves,1,Randomplayer)
print(table.unpack(Werewolves))
print(table.unpack(Villagers))
else
table.insert(Villagers,1,Randomplayer)
print(table.unpack(Werewolves))
print(table.unpack(Villagers))
end
end
game.Players.PlayerAdded:Connect(Randomizeplayer)
Thanks in advance!

4 comments
Is "table.getn(Werewolves)" trying to get the number of current werewolves?
yup
its raw random, add weights
add weights?