|
| 09 Jun 2015 08:54 AM |
an example would be: "table.insert(var, "Hello", "My", "Name", "Is", "?")" if it doesn't, then is there any other way of doing it with only one line of code? Thanks. |
|
|
| Report Abuse |
|
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
| |
|
| |
|
|
| 09 Jun 2015 08:57 AM |
| Players.Player.Backpack.LocalScript:26: wrong number of arguments to 'insert' |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 09:05 AM |
Yeah, you can't do it like that. You can make a function for it if you want.
local insert = function(Table, ...) for i, v in pairs({...}) do table.insert(Table, v) end end
insert(Table, "hi", 2, false, "no") |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 09:06 AM |
Sort of.
local a = {"a", "b", "c"}
setmetatable(a, { __concat = function(self, other) for i, v in pairs(other) do table.insert(self, v) end return self end})
a = a..({"d", "e", "f"}) |
|
|
| Report Abuse |
|
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
|
| 11 Jun 2015 11:55 PM |
var={}; table.insert(var,{Hello='Hello';My='My';Name='Name';Is='Is';['?']='?';}); print(var.Hello,var.My,var.Name,var.Is,var['?']);
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|