Hello,
I am trying to find out a way to protect my game from being saveinstance. I already have a script, but it’s not working. I’ve been trying to figure out the issue, but i could not find any way to solve the problem.
-- Anti saveinstance script, that doesn't work
script.Parent = nil -- I'm not sure what it does
local exception_list = {""}
local Players = game:GetService('Players')
local StarterPack = game:GetService('StarterPack')
local StarterGui = game:GetService('StarterGui')
local Lighting = game:GetService('Lighting')
local function call_on_descendants(instance, func)
func(instance) -- save instance function
for _, child in next, instance:GetChildren() do
call_on_descendants(child, func)
end
end
local function shutdown() -- if save instance then
pcall(function() -- clear everything
Players:ClearAllChildren()
StarterPack:ClearAllChildren()
StarterGui:ClearAllChildren()
Lighting:ClearAllChildren()
workspace:ClearAllChildren()
end)
Instance.new('Hint', workspace).Text = "We're Sorry. This game has been shutdown for place security reasons." -- instance a message
Instance.new('StringValue', workspace).Value = (" "):rep(2e5+1)
pcall(Instance.new, 'ManualSurfaceJointInstance')
workspace.Terrain:Clear() -- clear terrain
end
call_on_descendants(workspace, function(descendant)
descendant.Archivable = false
descendant.Changed:connect(function(property)
if property == 'Archivable' then -- if archivable then function shutdown
shutdown()
end
end)
end)
Trouble is the exploits can take your game and upload it as text to a file without the need to call on parts. Your better off just ensuring you are keepimg scripts in the server. If you are that worried about copies just make your game better than thiers.
People use it to hide scripts from exploiters, but there is a command they can run to get scripts with parents set to nil (cant remember exactly what the function is)
You can not set the parent of workspace, so no that would not work.
And just so you know, when exploiters download your game, they are not downloading any parts or server scripts. They download the local scripts of the game.
Unfortunately there is really no way to protect against SaveInstance()
There is no way to specifically protect your game from exploiters using SaveInstance, this detection method; I believe only works on Dex SaveInstance which practically nobody uses; every exploiter just calls saveinstance().
The only way to protect your game specifically from instance-saving, is creating a bunch of garbage scripts that fill up the decompiler; maybe make a bunch of junk code obfuscated to confuse the decompiler.
However, you can always pass {noscripts = true} as an argument to Synapse and scripts will not be saved. Unfortunately there is not very much you can do about this.