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

Whats another way of inserting a string into a table without using table.insert?

So I saw this script but I forgot it it used something like square brackets

Table[] = string

but I forgot what it was

1 comment

0

t[#t + 1] = "string" behaves like table.insert(t, "string"). t[n] behaves like table.insert(t, n, "string").

1 answer

✓ Accepted answer

These would be considered the same:

local array = {}

table.insert(array, 1, "String")

array[1] = "String"

In table.insert the IndexPosition (second parameter) must be a number

In the second example, the index (inside the brackets) is generally a string, but it can also be a number

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