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

Can Private Modules be used in tools?

I have a tool who's core function is in a private module. It works fine in studio but returns the error: 'require(assetId) cannot be called in client'.

2 comments

0

I don't see why this got down voted, it's a legitimate yes or no question. I'll look into it.

0

In the roblox API, it was stated that local scripts could not require a module script. Module scripts are server side only.

2 answers

✓ Accepted answer

There's not any practical way to do it. If a LocalScript has to access it, there's not a chance of it working because any code loaded to the client could be stolen anyway. If the code can be stolen, it's counterintuitive for it to be private.

Your best bet is to have all major logic handled by the server (Which should happen anyway) and any bridging event logic happening on the client. As it should be done.

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