Anticheat script disable check not working (server script)

 
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)

the title explains it

maybe try putting it inside the while loop?

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.

Don’t need to childremoved works, just not the .disabled part

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.

3 Likes

Disabled == false if your checking if the script is enabled

You can’t check if a player deleted a script from the server since it’s deleted only for the client. (As @JarodOfOrbiter mentioned

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.

1 Like

Maybe do this:

--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

Alright thanks I will check it on a local script :slight_smile:

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.

1 Like