Loaders are made using ModuleScripts, and they are generally more secure than having a script in-game.
Here's how to make one:
Create your ModuleScript (name it "MainModule", I also recommend you parent it to ServerStorage, as I have encountered some errors when it wasn't). It can also have children inside it, they get saved with the model.
Test your ModuleScript. If it works, upload it to ROBLOX (don't worry, it can be updated if you make some errors in your code).
Then, require it using it's ID. It will error if you do not own it and if it isn't free.
Example: (Edited)
MainModule (AssetId = 12345678)
local module = {}
local args
local admins
game.Players.PlayerAdded:connect(function(p)
repeat wait() until args and admins
if admins[p.Name] or admins[p.UserId] then
p.Chatted:connect(function(msg,rec)
end)
end
end)
function module:setup(arguments)
args = arguments
admins = args.admins
print("Fun commands " ..("enabled" and args.funCommands == true) or ("disabled" and args.funCommands == false).."!")
end
return module
Script
local args = {}
args.admins = {}
args.funCommands = true
local module = require(12345678)
module:setup(args)
There you go, your loader is done. Note that requiring using an ID doesn't work in LocalScripts.
Hope I helped!
~TDP
3 comments
Don't bother. Determined people will get the source no matter what.
It will still be cool to use, it will also be more organized.. I can also learn new things :D
They can't get it if it's not free, though. Unless, of course, ROBLOX is less secure than I thought..