Hi, I want to select a string from a table randomly but I want to be able to reference the space in which it’s selected. For example: Select a string from the table between strings 1 and 3. Then if it’s not too much trouble I would like to randomly put these strings into a series of text buttons randomly. Thanks
This will allow you to pick random strings from a table and also be able to reference them. As for the text buttons part, you could make a loop and keep on selecting strings over and over again for every button. If a string can only be used once, just remove it from the table.
local tbl = {"string1", "string2", "string3"} -- All strings
local chosen = math.random(1, #tbl) -- Pick a random number between 1 and the length of the table
print(tbl[chosen]) -- Prints out the string at that position