I was advised to rewrite the entire script since it only works for local scripts and that can easily be bypassed. What I am trying to do is have an anti-btools script since exploiters can still use btools to remove walls locally so they can traverse distances easily, whether to annoy people or not. I attempted to not only code the anti-exploit so that it kicks people but also certain group members that are in a certain rank or higher can bypass this. I cannot identify the problem causing the script not to work. I am kinda a rookie at scripting, sorry.
game.Players.PlayerAdded:connect(function(plr) local Backpack = plr:WaitForChild("Backpack") Backpack.ChildAdded:Connect(function(Obj) if Obj:IsA("HopperBin") then if plr:GetRankInGroup(10000) <= 20 then plr:Kick("Btools are not permitted, stop trying to exploit") print("Possible exploiter detected") local hint = Instance.new("Hint") hint.Text = plr.Name .. "possibly attempted to exploit" wait(15) hint:Destroy() end end end) end)
EDIT 1: I need to fix this script even tho there are other ways to locally destroy walls, otherwise it would become a very bad habit for me since I could not find problems in my code that causes it to not work.
EDIT 2: This post is a second attempt of trying to solve the anti-btools exploit with only certain people being able to use it. You might find another question prior to this that I posted. The previous post made by me is not a duplicate since they are both different scripts, the first one only worked for local scripts, my second script I rewrote was supposed to work serverside for more security.
At first, it seems like a good idea. But, do not make Anti-Exploit Systems because:
Unless you can detect if they have an installation, they can use it to their advantage.
If it is checking certain things they have in their StarterPack, Properties of the player to make sure they don't have some advantage (Like a position that couldn't be reached, high health or speed), delete it. The person can use their installation to make it so OTHER players get Banned by changing other players Properties and tools.
If they are aware of the anti-cheat, they could just put BTools in someone else's StarterPack, and the victim gets banned
Watch this: https://www.youtube.com/watch?v=nbiBSUNB0Gg