Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Adding a key to a table?

When you add something to a table, you usually add a value, right? But what if I wanted to add a key to that value when I add it to a table? Is this possible and if so how do I do it?

1 comment

0

For example table = {['index'] = value}

1 answer

✓ Accepted answer

This is how you do it:

local table = {}

table["Zombie"] = "I eat brainz"

The first part is simply indexing the key that you want to index. It creates a new value if the key does not exist. Then it sets the following value to be it's value.

This discussion is preserved as it was. New answers, comments, and votes are closed.