'LinKin Posted March 1, 2014 Posted March 1, 2014 Hi, I've a table like this: myTable[1] = "1st Text" myTable[2] = "2nd Text" myTable[3] = "3rd Text" myTable[4] = "4th Text" myTable[5] = "5th Text" Then, I add the event onClientRender to show the message that is in the first position of the table. And after 5 seconds, I stop showing it. But, after these 5 seconds, I also want to 'delete' the first position of the table, and move the other positions of it. So it'd look like this: myTable[1] = "2nd Text" myTable[2] = "3rd Text" myTable[3] = "4th Text" myTable[4] = "5th Text" So, the question is, what would happen to the 5th position of the table? Would it still occupate a memory's space?
'LinKin Posted March 1, 2014 Author Posted March 1, 2014 For example, if I do myTable[1] = nil and then I do table.insert(myTable, "some text"), would lua automatically place this in the 1st position of the table?
WhoAmI Posted March 1, 2014 Posted March 1, 2014 table.remove(table, [pos]) -- position of value in table, for example 1'st position is 1st text
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now