Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Does require() only work if the Module is in your inventory? [Unsolved]

I was wondering if anyone can tell me if the require(assetid) function only work's if they have the MainModule part in their inventory, cause I give my friend's a require(assetid) and it won't load for them but it load's for me.

1 answer

require(assetid) will work for any item on Roblox, although:

  • The item must be a modulescript
  • The item must be named "MainModule"
  • The script require'ing the module MUST be serverside, and it has to be a script (not localscript)

require(In-game module) will work on any modulescript, regardless of name, location or script-type.

In studio, require'ing the assetId will only work if it's in your inventory. To properly test it, it must be run on the server.

2 comments

0

My friend uploads it to a place and we go to it, and the ModuleScript doesn't load but it load's for me.

0

Hm, I know it definitely works, because Epix Incorporated Server Suite (the admin) uses it to auto-update. Maybe he's broken the require script?

This discussion is preserved as it was. New answers, comments, and votes are closed.