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

Is there a way to insert values in tabes that are inside of tables?

Asked by 9 years ago

My script:

t = {
    tier= {},
    cframe = {}
}

Is there a way to inset a value in the 'tier' table using table.insert?

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

Of course. Things inside tables are just normal values, so you can do anything to them that you can do to any value.

local cframes = t.cframes
table.insert( cframes, CFrame.new() )

-- or, more simply

table.insert( t.cframes, CFrame.new() )

One of the main goals of a programming language is to provide consistency. With only a few exceptions, code that works in one place in Lua works anywhere in Lua.

Ad

Answer this question