MaxMoss Posted June 5, 2023 Share Posted June 5, 2023 Hello I want to create a table like this: table = { [1] = {}, [2] = {}, [3] = {}, } And I want to change table 3 to table 2 when table 2 is deleted table = { [1] = {}, --[2] = {}, [2] = {}, } Sorry for my English, I took help from Google Translate Link to comment
βurak Posted June 6, 2023 Share Posted June 6, 2023 (edited) not sure but try using table.remove local tables = { [1] = {}, [2] = {}, [3] = {}, } table.remove(tables, 2) --remove 2. nested table for i,v in ipairs(tables) do print(i,v) end --[[ --normally 1 table: 0x5598d3662e90 2 table: 0x5598d3661670 3 table: 0x5598d36616b0 -- after table remove 1 table: 0x555c01b1c6b0 2 table: 0x555c01b1c6f0 ]]-- Edited June 6, 2023 by Burak5312 1 Link to comment
MaxMoss Posted June 7, 2023 Author Share Posted June 7, 2023 (edited) i try it Edited June 7, 2023 by MaxMoss wrong Link to comment
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