|
| 11 Jul 2015 09:31 AM |
How could I get the 1st table using the table that's inside it?
local tab = { test = { function() --get 'tab' end } }
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 09:38 AM |
can I actually do
local tab = { test = { function() local table = tab end } }
or what?
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 09:40 AM |
Why?
Couldn't you just do tab.Whatever.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 09:45 AM |
yeah I think it works from what I tested :D am just making something that includes metatables and really needed to know, since I need to use the previous made functions inside the main Table in some functions that are in the same table...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jul 2015 09:46 AM |
| This is why : syntax exists. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 09:49 AM |
em what exactly are ya saying? am confused XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 11 Jul 2015 09:52 AM |
ex.
local test = {}
test.Thing = function(self) print(self) end
test:Thing()
|
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 09:57 AM |
uh, no, I was aiming for,
tab = { tabl = { func() do stuff with tab end } }
since am gonna return tab with my module...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
|
| 11 Jul 2015 10:04 AM |
yeah, I said I found out it works XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 10:08 AM |
wait!
local timeFuncs = { ['get'] = function() --other stuff end }
--this function is also inside timeFuncs function() timeFuncs.get() end
attempt to index global 'timeFuncs' (a nil value)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 11 Jul 2015 10:08 AM |
timeFuncs.get()
while true do the do |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 10:10 AM |
"function() timeFuncs.get() end"
what does this look like??? o.O
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 10:20 AM |
now it's
attempt to index global 'T' (a nil value)
local T = {h, m, s, __add = function(s) local total = timeFuncs.get(T[3], T[2], T[1]) + s return timeFuncs.get(total) end;
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jul 2015 10:24 AM |
local timeFuncs; timeFuncs = {
};
return timeFuncs;
Prototyping for Lua |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 10:35 AM |
I found a way around it, thnx anyways :)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|