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

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

Asked by
4D_X 118
6 years ago
Edited 6 years ago

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

0
"table.insert(array<Variant> table, int index, Variant value)" User#17685 0 — 6y
0
int Index, that sounds sad :( User#17685 0 — 6y

1 answer

Log in to vote
0
Answered by
RayCurse 1518 Moderation Voter
6 years ago

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.

Ad

Answer this question