I'm curious about the best way to do this. I'm not sure if I have anything protected, and I think I need to!
For module scripts, I would make a table that holds all the modules that are needed. Example:
local Library = { ['Network'] = game:GetService('ReplicatedStorage'):WaitForChild('Network'); ['Settings'] = game:GetService('ReplicatedStorage'):WaitForChild('Settings'); ['Example'] = game:GetService('ReplicatedStorage'):WaitForChild('Example'); }; local Library_setup = function() for Module_name, Module in pairs(Library) do Library[Module_name] = require(Module); local Fake_duplicate = Instance.new(Module.ClassName); Fake_duplicate.Name = '\0'; Fake_duplicate.Parent = nil; Module.Name = '\0'; Module.Parent = nil; end; end; Library_setup();
This would first grab the original module script and save that script in the table. Then when you run the Library_setup() the modules name will become blank and its parent would become nil also it creates a new module with the same name with the same parent but with no source, This will be definitely more difficult for most average exploiters to find the original. Take this into advice it's still not exactly the most secure its just a more secure way to protect those module scripts from exploiters running require on them in a simple location.
But for RemoteEvents and RemoteFunctions there are a couple of ways to achieve a more secure network however for starters I would get into creating a system where it creates an access key. Example: Server:
local Access_keys = {}; local RemoteEvent = game:GetService('ReplicatedStorage'):WaitForChild('Example'); local HttpService = game:GetService('HttpService'); RemoteEvent.OnServerEvent:Connect(function(Player, Access_key, ...) local Arguments = { ... }; local Server_access_key = Access_keys[Player]; if not Server_access_key then Access_keys[Player] = HttpService:GenerateGUID(false); -- Stuff you want to do. RemoteEvent:FireClient(Player, Access_keys[Player]); else if Server_access_key == Access_key then -- Stuff you want to do. Access_keys[Player] = HttpService:GenerateGUID(false); RemoteEvent:FireClient(Player, Access_keys[Player]); end; end; end);
Client:
local RemoteEvent = game:GetService('ReplicatedStorage'):WaitForChild('Example'); local Client_access_key; RemoteEvent.OnClientEvent:Connect(function(Access_key, ...) local Arguments = { ... }; Client_access_key = Access_key; end); for X = 1, 10 do wait() RemoteEvent:FireServer(Client_access_key, 'Hello!'); end;
This is just a quick write up. There are more things you can do to protect the send of arguments to the server and prevent exploiters from seeing those arguments however that is quite a bigger script that I don't really wanna write right now.
this is not a request site.