|
| 05 Aug 2012 07:06 PM |
What does mod mean? I saw a script in a model rotation, and I addapted it to search for tables, but I'm getting a weird output :/ Can anyone help?
GetEverything = (function(Table) local parts ={} local TableTable = {} local Table = Table local function scan(Table) for _,item in pairs(Table) do if item.IsA ~= nil then if (item:IsA("BasePart")) then table.insert(parts,item) end else if type(item) == "table" then table.insert(TableTable, item) end end scan(item) end end scan(mod) TableTable = TableTable--TheTable parts = parts--Theparts end); GetEverything(game.Lighting:GetChildren())
Output:
table: 0x20a46620 20:00:44.056 - GetEverything = (function(Table) print(Table) local parts:6: attempt to get length of local 'Table' (a nil value) 20:00:44.057 - Script " GetEverything = (function(Table) print(Table) local parts", Line 6 - global scan 20:00:44.058 - Script " GetEverything = (function(Table) print(Table) local parts", Line 19 - global GetEverything 20:00:44.058 - Script " GetEverything = (function(Table) print(Table) local parts", Line 23 20:00:44.059 - stack end
So it thinks that Table == nil, but it's not... |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 05 Aug 2012 07:08 PM |
| "Mod" is whatever you define, however in this script, it's not defined. |
|
|
| Report Abuse |
|
|
josh50000
|
  |
| Joined: 29 Nov 2009 |
| Total Posts: 697 |
|
|
| 05 Aug 2012 07:10 PM |
| u havent set mod to anything |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2012 07:12 PM |
| Uhg, how to prevent stack overflow again? |
|
|
| Report Abuse |
|
|
josh50000
|
  |
| Joined: 29 Nov 2009 |
| Total Posts: 697 |
|
| |
|
|
| 05 Aug 2012 07:18 PM |
| Stack overflow happens when a function calls itself too many times. I tried wait(), but it doesn't work :/ |
|
|
| Report Abuse |
|
|
| |
|
| |
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 06 Aug 2012 09:20 PM |
You're getting a stack overflow because you're making too many recursive calls.
try changing scan(item) to return scan(item) |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2012 09:35 PM |
| I have a modded world at war game if that what you mean. |
|
|
| Report Abuse |
|
|