Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Key Removing?

Asked by 10 years ago

Let's say I added a key to a table and then that table only has that inside it, now I want to remove that key from the table. I'm having trouble with that can anyone help?

1 answer

Log in to vote
0
Answered by
Link43758 175
10 years ago

You can use the table.remove function (http://lua-users.org/wiki/TablesTutorial). In this case, all you need to do is add to your script the code:

table.remove(TABLENAME, 1)

Replacing TABLENAME with the name of the table that stores the key. Hope I've helped! If you have any questions, feel free to comment on this answer and I'll definitely help you.

0
Thank you MidnightDeveloper. CharcterKaiser 0 — 10y
0
What about if I wanted to remove a certain key like s or q? CharcterKaiser 0 — 10y
0
table[key] = nil Articulating 1335 — 10y
0
Thank you. CharcterKaiser 0 — 10y
0
It didn't work. CharcterKaiser 0 — 10y
Ad

Answer this question