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: require modulescript through getobjects?

Previous Thread :: Next Thread 
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 08:29 PM
i uploaded a modulescript and i'm trying to require it through getobjects in a serverscript, but it just returns "An error has occurred"

what's a functional way on doing this? help would be appreciated


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 09:24 PM
bump


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 09:25 PM
Why not just require the model id?
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 09:26 PM
what do you mean? how?


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 10:10 PM
bump


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 10:14 PM
Upload just the modulescript named "MainModule" then to require it use the id of the uploaded model like

local myModule = require(12345)
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 10:22 PM
thanks but why does it have to be named mainmodule


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 10:32 PM
Because of some arbitrary roblox stuff. It's just so you can name it something else if you don't want to be able to require it like that.
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
05 Aug 2016 10:48 PM
It doesn't have to be named MainModule... That's only if you want other people to require it and want to keep the source private. If you do that anyone can require and use the module.
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 10:54 PM
You could very well be right, I've never used it, but the wiki says this:
"If the ModuleScript instance is renamed to 'MainModule' and uploaded to ROBLOX, scripts can use require on the AssetId of the uploaded ModuleScript, allowing the creation of private modules."

From what I've heard that's necessary to use it, but I could definitely be wrong.
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