For example, the code below.
function chooseRandom()
local random = table[math.random(1, #table)]
return random
end
How can I check if the selected random value is "Test", for example? If it is Test, return the value... if not, choose another random value until it meets that condition.
Check the comments for another example.
There's probably a simple way to do this that I'm missing. Does anyone know a solution to accomplish this?

3 comments
Then why randomize it if you only want one option to be picked?
I'm just using that as an example. Lets say there is a BoolValue associated with each value in the table. I need to check if the value is true. If it is, return the value... if not, choose another random value until it is true.
if random == true then return random else return nil????