I'm trying to randomly select a player from the ServerPlayers
and then add them to the table called AlreadyChosen
. Once all the players have been chosen once, the table will clear itself and run again. I'm lost on how I can do this. Any help please?
local ServerPlayers = game.Players:GetChildren() local AlreadyChosen = {} repeat ChosenJeff = math.random(1,#ServerPlayers) until ServerPlayers[ChosenJeff].Name ~= AlreadyChosen local JeffName = ServerPlayers[ChosenJeff].Name table.insert(AlreadyChosen,JeffName)