Hi all,
I have got a bit of a problem that I haven’t managed to solve in Lua so far.
I have a table, let’s say this one: items_table = {1, 2, 3, 4, 5}. Each time the player clicks, I would like to take a random number from this table. My problem: these numbers should not repeat but I cannot just remove the number from the table, I need the table intact. In python, I would append the number to another list, compare both lists and if the number is in the second list, pick another number. But there is no “is in” or “is not in” in Lua like there is in python.
How could I go about doing this in Lua? Any hint would be greatly appreciated.