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

How would I add variable to table with script? Mine won't work.[UNSOLVED]

So I have a _G table and it goes like

_G.TrackNums = {

['abc'] = "blahblah"

}

but when I try to add something

table.insert(_G.TrackNums, [""..a] = "1 , Test")

it won't work help me please because i need this to work lol

2 comments

0

"table.insert(array table, int index, Variant value)"

0

int Index, that sounds sad :(

1 answer

✓ Accepted answer

I think that what you are trying to do is _G.TrackNums[""..a] = "1 , Test". The insert function is for inserting values with numerical indices. For example, table.insert(_G.TrackNums , 5 , "1 , Test" ) would insert the string with an integer index of 5.

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