Hello, I’m trying to create a system where you type
team1, team2 = chooseTeams(tableName)
and it returns 2 items randomly from a list but they can’t be the same (cant both return the same)
This is the function I’ve created:
function chooseTeams(tableToChoose) local team1 = table.Random(tableToChoose) local team2 = table.Random(tableToChoose) if team2 == team1 then chooseTeams(tableToChoose) end return team1, team2 end
But I tested it by printing the 2 variables and most of the time I didn’t get dupes but I still have occurrences of team1 and team2 being the same
Anyone know why this may be happening?