I know, this question is kind of similar to my last one, but I think I didn't explain well enough where my problem is. I want to assign certain players to random tables, and not random players to certain tables. I have absolutely no idea how to do it.
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!

9 comments
You can place your tables in an array, and from there use math.random to get a random table
I tried that, but it didn't work.
nvm
let me test that
How do you access an array within an array
Use math.random like Spjure said
I just found out the difference, so I mean a dictionary, not an array
access and array in a array = ARRAY[x][y]
dict[random(a,b)[random(c,d)]