[SOLVED] require(assetId) cannot be called from a client

I’m about 99% sure this wasn’t happening before today. This is the module in question. It should be able to be required from the client since it’s free, right?

EDIT: Seems I was mistaken

1 Like

I didn’t think you could do that for security reasons.

Requiring a module with the following code will probably give you the same function:

return require(moduleID)

The proper workaround is to have the module return a reference to itself, require it with a server script, and then parent the module to a place the localscript can access it from.

It’s an annoying workaround.

1 Like

[quote] The proper workaround is to have the module return a reference to itself, require it with a server script, and then parent the module to a place the localscript can access it from.

It’s an annoying workaround. [/quote]
Or have the server LoadAsset the ModuleScript and put it in ReplicatedStorage for clients to use.

If a client could require any assetID, they would have arbitrary localscript execution in any game. That would be a huge security hole.

2 Likes