game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
Char.ChildRemoved:Connect(function(child)
if child.ClassName == "LocalScript" or child.ClassName == "Script"then
player:Kick("pls stop using trash scripts - you have been perm banned for using trash scripts")
end
end)
while wait() do
wait(1)
for _,v in pairs(Char:GetChildren()) do
if v:IsA("LocalScript") and v.Disabled == true then
player:Kick("pls stop using trash scripts - you have been perm banned for using trash scripts")
end
end
end
end)
end)
Considering cheats first of all are usually parented to nil, and the fact they insert them through the client, server scripts won’t be able to find them or even detect them get removed.
It will continue to not work forever because the server cannot detect whether or not a local script has been deleted, disabled, or altered maliciously.
You should do this becuase it will delete the health and animate script from character:
if child.ClassName == "LocalScript" or child.ClassName == "Script" then
if child.Name ~= "Animate" and child.Name ~= "Health" then
--// Rest of code
end
end
That is true but you have to note that it is a server script, not local. And the server cannot detect if a script was disabled or removed due to it only being on the client, and the client only because exploits are client sided, of course unless there is a backdoor.
--ServerScript
if child.ClassName == "Script" then
if child.Name ~= "Health" then
--// Rest of code
end
end
--LocalScript
if child.ClassName == "LocalScript" then
if child.Name ~= "Animate" then
--// Rest of code
end
end
That should work, but the problem is exploiters can disable both scripts are the same time, instead, you could store the anti cheat or the checker in an important script that is needed for your game to work.
But, I also do believe their is a way players can still bypass anticheats with metatables, and it’s really easy to find with one google.