Say I have 3 numbers in a table and I want to remove one like following. I want to remove the number 5 from the table so that 7 will be in the 1 spot and 10 in the 2 spot. I cannot do ‘table.remove(ran, 1)’ because the 5 may not be in the 1 spot it will depend on the order in which the user presses the buttons. The way I am doing it is not removing the ‘5’ from the table. Thank you for assistance.
local ran = {}
table.insert(ran, 5)
table.insert(ran, 7)
table.insert(ran, 10)
table.remove(ran, ‘5’)
print( ran[2] )
–still printing 7, would like it to print 10