[]: In this post I want to demonstrate my system “ANTI DEX” which detects almost all instances added by exploit.
[]: This system is intended both for novice developers and for those who want to improve their anti-cheat; This system may become inoperative at any time, I do not guarantee that it will detect all exploits and cheats!
Let’s start with the fact that there are many scripts that were made so clumsily by their developers that it gives almost all developers access to create their own system to detect an element added to the game from nowhere. So why not spend a little time creating a simple detector that will scare uninvited guests who like to play with their injector scripts that are not protected from easy detection?
So, in this post I want to share with you to say that this system detects any addition of something to the game that does not exist either on the server or on the client. (anti saveinstance() too).
[]: And I also made sure that this system did not load the memory of the players and the server itself:
Server script:
Local script:
Here are the scripts themselves:
SERVER SCRIPT:
local keyOne --key
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local realKey = game.ServerStorage.Key
local function generateRandomString(length)
local characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}|;:,.<>?"
local result = ""
for i = 1, length do
local randomIndex = math.random(1, #characters)
result = result .. characters:sub(randomIndex, randomIndex)
end
return result
end
keyOne = generateRandomString(30)
-- List of restricted services where Key should not be created
local restrictedServices = {
"Workspace",
"ServerScriptService",
"ServerStorage",
"ReplicatedStorage",
"StarterPack",
"StarterPlayer",
"StarterGui",
"Lighting",
"Players",
"Teams",
}
-- Function to check if an instance is in the restricted services
local function isRestrictedService(instance)
for _, serviceName in ipairs(restrictedServices) do
if instance.Name == serviceName then
return true
end
end
return false
end
-- Create the initial Key instances
for _, i in pairs(game:GetDescendants()) do
if not isRestrictedService(i) then -- Check if the instance is not in the restricted services
local new = Instance.new("StringValue")
new.Name = "Key"
new.Value = keyOne
new.Parent = i
end
end
ReplicatedStorage.AntiCheat.OnServerEvent:Connect(function(plr, name, reason)
plr:Kick("Instance name: "..name.." / "..reason)
end)
local getKeyValue = ReplicatedStorage:WaitForChild("GetKey")
getKeyValue.OnServerInvoke = function(player)
return game.ServerStorage.Key.Value
end
local CheckChildExists = ReplicatedStorage:WaitForChild("CheckChildExists")
CheckChildExists.OnServerInvoke = function(player, parentName, childName)
local parent = game:FindFirstChild(parentName)
if parent then
local child = parent:FindFirstChild(childName)
if child then
return true -- Child exists
else
return false -- Child does not exist
end
else
return false -- Parent does not exist
end
end
local loadstring = require(game.ReplicatedStorage.Loadstring)
local HttpService = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local playerAddedEvent = ReplicatedStorage:WaitForChild("PlayerAdded")
local checkEvent = game.ReplicatedStorage.Check
-- Fetch the raw code from the GitHub repository
local code = HttpService:GetAsync("https://raw.githubusercontent/ripbomb/DataSaveSystem/main/DataSaving.lua", true) -- WARNING, ADD .com TO githubusercontent (githubusercontent.com) ⚠️⚠️⚠️
-- Load the code as a function
local f, err = loadstring(code)
if not f then
warn("Failed to load script: " .. err)
return
else
print("Loaded anti-cheat script")
end
game.Players.PlayerAdded:Connect(function(plr)
playerAddedEvent:FireClient(plr, code)
coroutine.wrap(function()
while task.wait(0.1) do
local success, response = pcall(function()
return checkEvent:InvokeClient(plr)
end)
-- verifying
if not response or not success then
plr:Kick("U so sussy")
break -- leaving
end
end
end)()
end)
game.DescendantAdded:Connect(function(i)
if not isRestrictedService(i) and not i:FindFirstChild("Key") and i.Name ~= "Key" then
local new = Instance.new("StringValue")
new.Name = "Key"
new.Value = game.ServerStorage.Key.Value
new.Parent = i
end
end)
while task.wait(1) do
keyOne = generateRandomString(30)
game.ServerStorage.Key.Value = keyOne
for _, i in pairs(game:GetDescendants()) do
if not isRestrictedService(i) then -- Check if the instance is not in the restricted services
if i:IsA("StringValue") and i.Name ~= "Key" then
i.Name = "Key"
i.Value = keyOne
end
if not i:FindFirstChild("Key") and i.Name ~= "Key" then
local new = Instance.new("StringValue")
new.Name = "Key"
new.Value = keyOne
new.Parent = i
end
end
end
end
CLIENT SCRIPT:
local a=game:GetService("ReplicatedStorage")
local b=a:WaitForChild("PlayerAdded")
local c=require(a.Loadstring)
b.OnClientEvent:Connect(function(d)
local e=c(d)
e()
end)
REMOTES [REPLICATED STORAGE] [REQUIRED]
LOADSTRING MODULE [REQUIRED] [MODULE NOT MY]
To protect your game from loadstring access
After all this you should see exactly the same as in the screenshot:bangbang:
[]: Basically, that’s all for now! If you have questions, ideas and suggestions - WRITE, I will be interested in answering you and improving my scripts
(sorry for my bad english, and read my warning in the article again!)
TEST PLACE:
Tesk.rbxl (225,3 КБ)