Waccsadac
|
  |
| Joined: 02 Jun 2012 |
| Total Posts: 2440 |
|
|
| 27 Jan 2016 09:34 AM |
This is in a Module script, so I dont know the error... function loadfort() s=script:GetChildren() for i=1,#s,395 do for x=0,394 do s[i+x].Parent=workspace end wait() end end return loadfort()
this is the script starting it: m=require(script.Parent.MainModule) m.loadfort()
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 09:42 AM |
return loadfort loadfort = require(script.parent.MainModule) loadfort()
You should not return the value of the function *call*, just the function itself |
|
|
| Report Abuse |
|
|
WoolHat
|
  |
| Joined: 19 May 2013 |
| Total Posts: 1873 |
|
|
| 27 Jan 2016 09:43 AM |
| If I'm understanding this correctly, remove the 395 in your first for loop. That third argument is the step size. So if you had maybe 1000 children, the first run through the loop would set i equal to 395,the second would be 790. But I get the hunch that's not what you want. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 09:43 AM |
| Actually, Wool, I think that is what he wants. See the second loop? |
|
|
| Report Abuse |
|
|
Waccsadac
|
  |
| Joined: 02 Jun 2012 |
| Total Posts: 2440 |
|
|
| 27 Jan 2016 10:03 AM |
Everything in there is intentional.
modulescript not changed except return loadfort(), Ive done like you suggested.
loadfort = require(348757778) loadfort()
Still not working.
Yes, the modulescript is the only thing in the model witht hat id
|
|
|
| Report Abuse |
|
|
gskw
|
  |
| Joined: 05 Jan 2013 |
| Total Posts: 1364 |
|
|
| 27 Jan 2016 10:28 AM |
| Did you get rid of the parenthesis on the last line of the ModuleScript? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 27 Jan 2016 10:52 AM |
Is it uploaded with the name "MainModule"?
|
|
|
| Report Abuse |
|
|
Waccsadac
|
  |
| Joined: 02 Jun 2012 |
| Total Posts: 2440 |
|
|
| 27 Jan 2016 12:31 PM |
Yes, it's named MainModule. Normal script located in Workspace:
loadfort = require(348757778) loadfort()
ModuleScript
function loadfort() s=script:GetChildren() for i=1,#s,395 do for x=0,394 do s[i+x].Parent=workspace end wait() end end return loadfort
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:37 PM |
module = require(348757778) module:loadfort()
ModuleScript
local module = {}
function module:loadfort() s=script:GetChildren() for i=1,#s,395 do for x=0,394 do s[i+x].Parent=workspace end wait() end end return module
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:39 PM |
| I just tested it, it works fine as far as loading the module. So your script must just not be written to do what you want. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:40 PM |
| HappyWalker all you did was needlessly put it into a table...? Modules can return any value not just tables. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:46 PM |
well the other thing didn't work for him
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:51 PM |
| I tested it and it works fine at requiring, he just made his script do the wrong thing |
|
|
| Report Abuse |
|
|