Using a module script or require alone, whatever you’re trying to do, won’t prevent leaking. Your client is buying your product. They need to be trusted. And what are the chances this will even happen in the first place? What you don’t know won’t hurt you if it does happen.
Keep in mind that unless you obfuscate your the code within your MainModule, the client will still be able to easily read it as the MainModule must remain public.
However, if you wish to use modules to make an easily updated GUI, what you would have to do is upload your MainModule script to roblox, then require the asset’s id (can be found in the url).
function module.load(target)
_G.target = target
local target = game.Players:WaitForChild(_G.target)
script.guinamehere:Clone().Parent = target.PlayerGui
end
return module`