|
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()
|
|
|
return loadfort
loadfort = require(script.parent.MainModule)
loadfort()
You should not return the value of the function *call*, just the function itself |
|
WoolHatJoin Date: 2013-05-19 Post Count: 1873 |
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. |
|
|
Actually, Wool, I think that is what he wants. See the second loop? |
|
|
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
|
|
gskwJoin Date: 2013-01-05 Post Count: 1364 |
Did you get rid of the parenthesis on the last line of the ModuleScript? |
|
chimmihcJoin Date: 2014-09-01 Post Count: 17143 |
Is it uploaded with the name "MainModule"?
|
|
|
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
|
|
|
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
|
|
|
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. |
|
|
HappyWalker all you did was needlessly put it into a table...? Modules can return any value not just tables. |
|
|
well the other thing didn't work for him
|
|
|
I tested it and it works fine at requiring, he just made his script do the wrong thing |
|