Are Roblox ModuleScripts Private?

Hello everyone,
Just wanted to ask if ModuleScripts are private, or how to make them private if there is a way for them to be public. I’m trying to use this module to store any API key to prevent accidental leaking in livestreams etc., but I also don’t want people to just be able to get it through a require.

I’ve seen no actual conversation about this somehow, so just wanted to make sure my API wouldn’t be public if I were to publish it like this.

I currently have a test module with “Allow Copying” set to off, and testing require on it gets me this:
Downloading asset failed for asset id 9297748841. Is the asset id correct and is the asset type "Model"?

Here’s my code as well:

local module = require(9297748841)
module.test()

Is this an error with my code, or does this mean that I’m doing this right, and that my module is private?

Thanks!

I’m (pretty) sure you just have to put the item offsale for it to be unusable for others when using require

Roblox only removed the ability to use third-party closed-source modules. So if it’s yours you can use it even if it’s off sale and nobody else can use it. Also make sure the module is specifically named “MainModule” when you publish it, perhaps that is why this error shows.

1 Like