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
|
  |
| 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
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 05 Aug 2016 09:25 PM |
| Why not just require the model id? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|