generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: modulescript help?

Previous Thread :: Next Thread 
Waccsadac is not online. 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
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
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 is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Jan 2016 09:43 AM
Actually, Wool, I think that is what he wants. See the second loop?
Report Abuse
Waccsadac is not online. 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 is not online. 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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
27 Jan 2016 10:52 AM
Is it uploaded with the name "MainModule"?


Report Abuse
Waccsadac is not online. 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
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
27 Jan 2016 12:46 PM
well the other thing didn't work for him


Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image