Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

MainModule and PrivateModule, how to use them?

Asked by 6 years ago

Hi guys!

So I recently got into this ModuleScript business and I'm quite interested..

Let's say I'm working for this kid who pays me on a monthly basis in return for usage of my scripts, and he ends up not paying me after 3 months. I would be able to completely disable my scripts if I were to link all my scripts to my PrivateModule.

Now my question is; How the hell do I link them?

I've created a simple MainModule script with the following code:

local module = {}

    function module.test()
            print("Working Module!")
    end

return module

This ModuleScript was named "MainModule" and uploaded as a Model to ROBLOX. I copied the ID and pasted the following code into my NORMAL script:

module = require(ID_HERE)
module.test()

I published my game, but whenever I try to test the scripts in studio I get the error "Unable to find module for asset id" in my output, and I see no print from the ModuleScript.

Is there any way for me to fix this issue? I would honestly love to use this type of script, but for some reason I just cannot manage to get it to work..

Another question about these scripts is; How do I make sure only I can access this ModuleScript (Refering to the kid who didn't pay up)? I want to save my MainModule as a ROBLOX Module, be able to update it in my own games, and then have it update on other games where it's linked aswell via the require code.

Thanks!

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

Basically, if somebody else tries to require it; you can just blacklist their place id; or creatorid. If you check the "game" object, it will show you the place id; aswell as the userId of the player who created it. You could also check for a gamepass etc. Monthly renewals would need to be manually done, unless you had an external service that handled it, with the module script checking an endpoint api to see if that user has payed their fees etc.

0
Note: I once tried this kinda stuff. Turns out, people aren't always offering to pay for stuff like this. You would need your scripts to be extremely complex and useful for anyone to want to buy it. H4X0MSYT 536 — 6y
0
No no, you're getting me wrong. I ment it as a way where all my created scripts are linked to a private modulescript, so if they end up scamming me or not paying me at the end of the month, I would just update the script to disable all of my other scripts in their game. User#20989 0 — 6y
0
The module scripts could require another module script; which just represents a value like names or something of blacklisted players, or even just a true/false value. H4X0MSYT 536 — 6y
Ad

Answer this question