|
| 05 Feb 2014 10:53 AM |
There is a function which is this
function findAllFlagStands(root) local c = root:children() for i=1,#c do if (c[i].className == "Model" or c[i].className == "Part") then findAllFlagStands(c[i]) end if (c[i].className == "FlagStand") then table.insert(stands, c[i]) end end end
I call it later but the output refers to me calling the function nil
I tried calling it by
findAllFlagStands(root) and findAllFlagStands() same result, whats wrong with it>?
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2014 10:55 AM |
| Wouldn't it be easier to use a (for i, v in pairs(root) do) loop? |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2014 10:56 AM |
| uh idk how to do that, this script also makes the leaderboard so it adds on Kills and Points |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 05 Feb 2014 12:38 PM |
function findAllFlagStands(root) local c = root:GetChildren() for i, v in pairs(c) do if (v.className == "Model" or v.className == "Part") then findAllFlagStands(v) end if (v.className == "FlagStand") then table.insert(stands, v) end end end
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2014 12:39 PM |
| Oh, your problem is you did root:children(). It should be root:GetChildren() I think. Use the script I just posted and see if it works. |
|
|
| Report Abuse |
|
|
Kingmouli
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 1292 |
|
|
| 05 Feb 2014 12:58 PM |
| On what did you call root, OP? |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2014 01:38 PM |
@ above, ?
13:37:33.009 - Workspace.LinkedLeaderboard:80: attempt to call global 'findAllFlagStands' (a nil value) 13:37:33.010 - Script 'Workspace.LinkedLeaderboard', Line 80 13:37:33.011 - stack end
is the output after i put in your script, It was the same thing before i put it in aswell |
|
|
| Report Abuse |
|
|
Kingmouli
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 1292 |
|
|
| 06 Feb 2014 11:36 AM |
function findAllFlagStands(root) --things end
What is root when you call the function? |
|
|
| Report Abuse |
|
|
| |
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 06 Feb 2014 04:19 PM |
OP clearly didn't make this.
Life is potatoes to me |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 06 Feb 2014 04:22 PM |
^ Yeah and on top of that, he didn't call the function correct. |
|
|
| Report Abuse |
|
|