How to protect your scripts/models

This guide was written by MrStebastien for the Roblox communities

Hello, before I start, I would like to tell you who I am and why I have written this. I am MrStebastien, a French developer and aviation enthusiast. I have written this because I think there are not a lot of tutorials that explain how to protect scripts/models that you’ve made and that you do not want them to get stolen.

I will explain it in a step by step guide. You will need the following things:
-A whitelist system
-Obfuscate your script
Let’s jump straight into it!

Whitelist system

A whitelist system is one of the primary things that you will need. But first, what is a whitelist system? A whitelist system is the opposite of a blacklist. Whitelist means that only certain players that are on a certain list are allowed to do something, in this case, use your models.
To get a whitelist you can either, make one or either buy one.
I will first explain to you how to make one.
Easy
You can make a script in which you can put the names of the players that you will allow to use the model. You will need to edit this script each time you want to add someone.

Advanced
To make an “advanced” whitelist system, you will need to know how to use the HTTPS requests and API. For this, you will create an external web server that will have a database. The database would look something like this: [Username]; [Product1=(true/false)]; [Product2=(true/false)].
Then you will need to make a script that will basically with the HTTPS requests go ask the server’s database if the user has the product set to true. Then if yes, you can make something happen, and if no, you can also make something happen (such as delete the model). You will be able to add new players on your web and won’t need to modify the script each time you want to add someone. You will need, however, to tell the player to enable https. You can also make so whenever https is off, it does the same action as it would do if the player has the product on false in the database. You can also connect the server and a Discord bot to add a user each time you run a command.

Buying a whitelist
If you are too lazy or do not know how to make a whitelist, you can buy it. I would really suggest using PodTech’s myPod system. It comes with a Hub and a whitelist system. (PodTech - Roblox)

Obfuscation

The whitelist is a good thing, but anyone can delete it! This is why I suggest you obfuscate a script in a few ways.
First, you will need to put the whitelist in a module. Then what I usually do, is add in the module the most important parts, that make the system work. The module will move them into your model once it gets inserted. Do not forget to name the module script “MainModule” or else it won’t be able to get inserted!
You will then publish the module script to Roblox and take the ID.
You will then insert a script somewhere in your model. I usually name it “Loader” so people know that they have to not delete it.
You will need to know though, that the module will always get inserted in the workspace no matter what, even if you put the loader in a part.
In the Loader, you will put the following thing:

require(MODULE ID, THE ONE YOU PUBLISHED)

For the example, I will use “123456789” as the Module ID.
The thing is that you will need to make the Module public as you can no longer require private modules. This feature was removed when the toolbox got “infected”. I suggest making your inventory private to everyone.
Now we have another problem. Everyone can just take the ID, replace it in the search bar, he will then find the module and he can take it for free. But that’s not what we want!. So you will need to obfuscate your script. Before I tell you how to do it, please know that “obfuscate” means unclear, illegible. This does not mean “undeletable”.
To obfuscate you can use Synapse Xen, Ironbrew, etc (I never used Synapse Xen, I always use Ironbrew so I am going to teach you with Ironbrew).
Since I am not allowed to put the link to the obfuscator, I will just show you to what the code will get transformed to, and will put the link to a YouTube video that is a guide with an Ironbrew obfuscator. (https://www.youtube.com/watch?v=ODD41wm-21A)
So something like this:

require(123456789)

Will look like this when obfuscated through Ironbrew:

return(function(IIIllIIllIIIllIIIIl,lllIIlllIllIlllIII,lllIIlllIllIlllIII)local lIIIlIlllIlIlIII=string.char;local IllIlIIIIIlIIllIl=string.sub;local IIllIlIIII=table.concat;local llIllIllllllIlIIllIlllI=math.ldexp;local lllIlllIlIIIll=getfenv or function()return _ENV end;local IlIlIIlllII=select;local lllIIlllIllIlllIII=unpack or table.unpack;local lllIIlllIllIlllIII=tonumber;local IIIIIIIIll='\171\169\169\169\168\174\169\169\169\219\204\216\220\192\219\204\169\169\169\169\253\157\198\52\232\169\173\169\169\169\187\173\169\169\169\168\169\169\169\187\175\169\168\169\171\169\169\169\169\171\169\169\169\171\169\168\169\169\174\169\169\169\168\169\169\169\169\169\169\169';local lllIIlllIllIlllIII=(bit or bit32);local IIIlllllIlIIIll=lllIIlllIllIlllIII and lllIIlllIllIlllIII.bxor or function(lllIIlllIllIlllIII,IIIIIlIIIIII)local llIlIlIlllIIIlllIlIIIIII,IIIlllllIlIIIll,lIlIIIIIIllI=1,0,10 while lllIIlllIllIlllIII>0 and IIIIIlIIIIII>0 do local IIIlllllll,lIlIIIIIIllI=lllIIlllIllIlllIII%2,IIIIIlIIIIII%2 if IIIlllllll~=lIlIIIIIIllI then IIIlllllIlIIIll=IIIlllllIlIIIll+llIlIlIlllIIIlllIlIIIIII end lllIIlllIllIlllIII,IIIIIlIIIIII,llIlIlIlllIIIlllIlIIIIII=(lllIIlllIllIlllIII-IIIlllllll)/2,(IIIIIlIIIIII-lIlIIIIIIllI)/2,llIlIlIlllIIIlllIlIIIIII*2 end if lllIIlllIllIlllIII<IIIIIlIIIIII then lllIIlllIllIlllIII=IIIIIlIIIIII end while lllIIlllIllIlllIII>0 do local IIIIIlIIIIII=lllIIlllIllIlllIII%2 if IIIIIlIIIIII>0 then IIIlllllIlIIIll=IIIlllllIlIIIll+llIlIlIlllIIIlllIlIIIIII end lllIIlllIllIlllIII,llIlIlIlllIIIlllIlIIIIII=(lllIIlllIllIlllIII-IIIIIlIIIIII)/2,llIlIlIlllIIIlllIlIIIIII*2 end return IIIlllllIlIIIll end local function IIIIIlIIIIII(llIlIlIlllIIIlllIlIIIIII,lllIIlllIllIlllIII,IIIIIlIIIIII)if IIIIIlIIIIII then local lllIIlllIllIlllIII=(llIlIlIlllIIIlllIlIIIIII/2^(lllIIlllIllIlllIII-1))%2^((IIIIIlIIIIII-1)-(lllIIlllIllIlllIII-1)+1);return lllIIlllIllIlllIII-lllIIlllIllIlllIII%1;else local lllIIlllIllIlllIII=2^(lllIIlllIllIlllIII-1);return(llIlIlIlllIIIlllIlIIIIII%(lllIIlllIllIlllIII+lllIIlllIllIlllIII)>=lllIIlllIllIlllIII)and 1 or 0;end;end;local lllIIlllIllIlllIII=1;local function llIlIlIlllIIIlllIlIIIIII()local IIIlllllll,lIlIIIIIIllI,IIIIIlIIIIII,llIlIlIlllIIIlllIlIIIIII=IIIllIIllIIIllIIIIl(IIIIIIIIll,lllIIlllIllIlllIII,lllIIlllIllIlllIII+3);IIIlllllll=IIIlllllIlIIIll(IIIlllllll,169)lIlIIIIIIllI=IIIlllllIlIIIll(lIlIIIIIIllI,169)IIIIIlIIIIII=IIIlllllIlIIIll(IIIIIlIIIIII,169)llIlIlIlllIIIlllIlIIIIII=IIIlllllIlIIIll(llIlIlIlllIIIlllIlIIIIII,169)lllIIlllIllIlllIII=lllIIlllIllIlllIII+4;return(llIlIlIlllIIIlllIlIIIIII*16777216)+(IIIIIlIIIIII*65536)+(lIlIIIIIIllI*256)+IIIlllllll;end;local function IIIlllllll()local llIlIlIlllIIIlllIlIIIIII=IIIlllllIlIIIll(IIIllIIllIIIllIIIIl(IIIIIIIIll,lllIIlllIllIlllIII,lllIIlllIllIlllIII),169);lllIIlllIllIlllIII=lllIIlllIllIlllIII+1;return llIlIlIlllIIIlllIlIIIIII;end;local function lIlIIIIIIllI()local llIlIlIlllIIIlllIlIIIIII,IIIIIlIIIIII=IIIllIIllIIIllIIIIl(IIIIIIIIll,lllIIlllIllIlllIII,lllIIlllIllIlllIII+2);llIlIlIlllIIIlllIlIIIIII=IIIlllllIlIIIll(llIlIlIlllIIIlllIlIIIIII,169)IIIIIlIIIIII=IIIlllllIlIIIll(IIIIIlIIIIII,169)lllIIlllIllIlllIII=lllIIlllIllIlllIII+2;return(IIIIIlIIIIII*256)+llIlIlIlllIIIlllIlIIIIII;end;local function IIIllIIl()local lllIIlllIllIlllIII=llIlIlIlllIIIlllIlIIIIII();local llIlIlIlllIIIlllIlIIIIII=llIlIlIlllIIIlllIlIIIIII();local lIlIIIIIIllI=1;local IIIlllllIlIIIll=(IIIIIlIIIIII(llIlIlIlllIIIlllIlIIIIII,1,20)*(2^32))+lllIIlllIllIlllIII;local lllIIlllIllIlllIII=IIIIIlIIIIII(llIlIlIlllIIIlllIlIIIIII,21,31);local llIlIlIlllIIIlllIlIIIIII=((-1)^IIIIIlIIIIII(llIlIlIlllIIIlllIlIIIIII,32));if(lllIIlllIllIlllIII==0)then if(IIIlllllIlIIIll==0)then return llIlIlIlllIIIlllIlIIIIII*0;else lllIIlllIllIlllIII=1;lIlIIIIIIllI=0;end;elseif(lllIIlllIllIlllIII==2047)then return(IIIlllllIlIIIll==0)and(llIlIlIlllIIIlllIlIIIIII*(1/0))or(llIlIlIlllIIIlllIlIIIIII*(0/0));end;return llIllIllllllIlIIllIlllI(llIlIlIlllIIIlllIlIIIIII,lllIIlllIllIlllIII-1023)*(lIlIIIIIIllI+(IIIlllllIlIIIll/(2^52)));end;local llIllIllllllIlIIllIlllI=llIlIlIlllIIIlllIlIIIIII;local function lIllIIlIlIIllIllI(llIlIlIlllIIIlllIlIIIIII)local IIIIIlIIIIII;if(not llIlIlIlllIIIlllIlIIIIII)then llIlIlIlllIIIlllIlIIIIII=llIllIllllllIlIIllIlllI();if(llIlIlIlllIIIlllIlIIIIII==0)then return'';end;end;IIIIIlIIIIII=IllIlIIIIIlIIllIl(IIIIIIIIll,lllIIlllIllIlllIII,lllIIlllIllIlllIII+llIlIlIlllIIIlllIlIIIIII-1);lllIIlllIllIlllIII=lllIIlllIllIlllIII+llIlIlIlllIIIlllIlIIIIII;local llIlIlIlllIIIlllIlIIIIII={}for lllIIlllIllIlllIII=1,#IIIIIlIIIIII do llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII]=lIIIlIlllIlIlIII(IIIlllllIlIIIll(IIIllIIllIIIllIIIIl(IllIlIIIIIlIIllIl(IIIIIlIIIIII,lllIIlllIllIlllIII,lllIIlllIllIlllIII)),169))end return IIllIlIIII(llIlIlIlllIIIlllIlIIIIII);end;local lllIIlllIllIlllIII=llIlIlIlllIIIlllIlIIIIII;local function lIIIlIlllIlIlIII(...)return{...},IlIlIIlllII('#',...)end local function IllIlIIIIIlIIllIl()local IIIIIIIIll={};local IlIlIIlllII={};local lllIIlllIllIlllIII={};local llIllIllllllIlIIllIlllI={[#{"1 + 1 = 111";"1 + 1 = 111";}]=IlIlIIlllII,[#{"1 + 1 = 111";{480;758;17;235};"1 + 1 = 111";}]=nil,[#{"1 + 1 = 111";{571;134;739;621};"1 + 1 = 111";{931;437;673;725};}]=lllIIlllIllIlllIII,[#{"1 + 1 = 111";}]=IIIIIIIIll,};local lllIIlllIllIlllIII=llIlIlIlllIIIlllIlIIIIII()local IIIllIIllIIIllIIIIl={}for IIIIIlIIIIII=1,lllIIlllIllIlllIII do local llIlIlIlllIIIlllIlIIIIII=IIIlllllll();local lllIIlllIllIlllIII;if(llIlIlIlllIIIlllIlIIIIII==3)then lllIIlllIllIlllIII=(IIIlllllll()~=0);elseif(llIlIlIlllIIIlllIlIIIIII==0)then lllIIlllIllIlllIII=IIIllIIl();elseif(llIlIlIlllIIIlllIlIIIIII==1)then lllIIlllIllIlllIII=lIllIIlIlIIllIllI();end;IIIllIIllIIIllIIIIl[IIIIIlIIIIII]=lllIIlllIllIlllIII;end;llIllIllllllIlIIllIlllI[3]=IIIlllllll();for IllIlIIIIIlIIllIl=1,llIlIlIlllIIIlllIlIIIIII()do local lllIIlllIllIlllIII=IIIlllllll();if(IIIIIlIIIIII(lllIIlllIllIlllIII,1,1)==0)then local IIIlllllIlIIIll=IIIIIlIIIIII(lllIIlllIllIlllIII,2,3);local IIIlllllll=IIIIIlIIIIII(lllIIlllIllIlllIII,4,6);local lllIIlllIllIlllIII={lIlIIIIIIllI(),lIlIIIIIIllI(),nil,nil};if(IIIlllllIlIIIll==0)then lllIIlllIllIlllIII[#("K2x")]=lIlIIIIIIllI();lllIIlllIllIlllIII[#("beiq")]=lIlIIIIIIllI();elseif(IIIlllllIlIIIll==1)then lllIIlllIllIlllIII[#("0EY")]=llIlIlIlllIIIlllIlIIIIII();elseif(IIIlllllIlIIIll==2)then lllIIlllIllIlllIII[#("BTS")]=llIlIlIlllIIIlllIlIIIIII()-(2^16)elseif(IIIlllllIlIIIll==3)then lllIIlllIllIlllIII[#("fvx")]=llIlIlIlllIIIlllIlIIIIII()-(2^16)lllIIlllIllIlllIII[#("Gm8b")]=lIlIIIIIIllI();end;if(IIIIIlIIIIII(IIIlllllll,1,1)==1)then lllIIlllIllIlllIII[#("gi")]=IIIllIIllIIIllIIIIl[lllIIlllIllIlllIII[#("kg")]]end if(IIIIIlIIIIII(IIIlllllll,2,2)==1)then lllIIlllIllIlllIII[#("mKM")]=IIIllIIllIIIllIIIIl[lllIIlllIllIlllIII[#{{691;684;472;835};{25;508;134;555};"1 + 1 = 111";}]]end if(IIIIIlIIIIII(IIIlllllll,3,3)==1)then lllIIlllIllIlllIII[#("A8io")]=IIIllIIllIIIllIIIIl[lllIIlllIllIlllIII[#("UQLJ")]]end IIIIIIIIll[IllIlIIIIIlIIllIl]=lllIIlllIllIlllIII;end end;for lllIIlllIllIlllIII=1,llIlIlIlllIIIlllIlIIIIII()do IlIlIIlllII[lllIIlllIllIlllIII-1]=IllIlIIIIIlIIllIl();end;return llIllIllllllIlIIllIlllI;end;local function IIIIIIIIll(lllIIlllIllIlllIII,llIlIlIlllIIIlllIlIIIIII,lIlIIIIIIllI)lllIIlllIllIlllIII=(lllIIlllIllIlllIII==true and IllIlIIIIIlIIllIl())or lllIIlllIllIlllIII;return(function(...)local IllIlIIIIIlIIllIl=lllIIlllIllIlllIII[1];local IIIIIlIIIIII=lllIIlllIllIlllIII[3];local lllIIlllIllIlllIII=lllIIlllIllIlllIII[2];local lllIIlllIllIlllIII=lIIIlIlllIlIlIII local IIIlllllIlIIIll=1;local lllIIlllIllIlllIII=-1;local IIIIIIIIll={};local IIIllIIllIIIllIIIIl={...};local IIIlllllll=IlIlIIlllII('#',...)-1;local lllIIlllIllIlllIII={};local llIlIlIlllIIIlllIlIIIIII={};for lllIIlllIllIlllIII=0,IIIlllllll do if(lllIIlllIllIlllIII>=IIIIIlIIIIII)then IIIIIIIIll[lllIIlllIllIlllIII-IIIIIlIIIIII]=IIIllIIllIIIllIIIIl[lllIIlllIllIlllIII+1];else llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII]=IIIllIIllIIIllIIIIl[lllIIlllIllIlllIII+#{{585;395;876;594};}];end;end;local lllIIlllIllIlllIII=IIIlllllll-IIIIIlIIIIII+1 local lllIIlllIllIlllIII;local IIIIIlIIIIII;while true do lllIIlllIllIlllIII=IllIlIIIIIlIIllIl[IIIlllllIlIIIll];IIIIIlIIIIII=lllIIlllIllIlllIII[#("O")];if IIIIIlIIIIII<=#{{477;786;253;409};{7;169;739;559};{267;8;375;365};}then if IIIIIlIIIIII<=#("W")then if IIIIIlIIIIII>#("")then llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII[#("hQ")]]=lllIIlllIllIlllIII[#("806")];else local lllIIlllIllIlllIII=lllIIlllIllIlllIII[#("0y")]llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII](llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII+1])end;elseif IIIIIlIIIIII>#("fT")then do return end;else local lllIIlllIllIlllIII=lllIIlllIllIlllIII[#("a8")]llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII](llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII+1])end;elseif IIIIIlIIIIII<=#("hsHE0")then if IIIIIlIIIIII==#("pB6j")then llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII[#("ru")]]=lIlIIIIIIllI[lllIIlllIllIlllIII[#("tbB")]];else llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII[#("3N")]]=lIlIIIIIIllI[lllIIlllIllIlllIII[#("Y6K")]];end;elseif IIIIIlIIIIII>#("nUChr4")then do return end;else llIlIlIlllIIIlllIlIIIIII[lllIIlllIllIlllIII[#("Uu")]]=lllIIlllIllIlllIII[#("rLZ")];end;IIIlllllIlIIIll=IIIlllllIlIIIll+1;end;end);end;return IIIIIIIIll(true,{},lllIlllIlIIIll())();end)(string.byte,table.insert,setmetatable);

Pretty illegible right?
Once you’ve done this, just replace the non-obfuscated script by the obfuscated one. And it should work!

I hope this will help you. If I forgot anything that is important or if I did something wrong, please do not hesitate to PM me via the Devforum.

4 Likes