I Want to make it so if the anticheat folder i made is deleted in playerscripts the player gets kicked
it does not work
i looked for solutions on the devforum and i didnt find anything
local player = game.Players.LocalPlayer
player.PlayerScripts:WaitForChild("Anticheat").DescendantRemoving:Connect(function(Child)
if Child.Name == "Anticheat" then
player:Kick("Imagine trying to delete an anticheat folder")
end
end)
I don’t think you understand what .DescendantRemoving does,
It fires when a descendant removes, you are looking for the Anticheat folder te be removed.
so you should use
local player = game.Players.LocalPlayer
player.PlayerScripts.DescendantRemoving:Connect(function(Child)
if Child.Name == "Anticheat" then
player:Kick("Imagine trying to delete an anticheat folder")
end
end)
Now it fires when a descendant is removed from PlayerScripts.