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.

9 comments
I don't know if this is the perfect solution, but at first just detect if anyone has btools and kick them, then implement the group stuff
I thought the script would detect the hopperbin then check if the player is in the group or in a certain rank or higher, if not, you would get kicked out.
First, you should use "tool", hopper bins are now depreciated, Second, you should use uppercase "Connect" as lowercase is depreciated, Third, you can just remove the whole Hint part, as "Hint" is depreciated, you can use TextLabels instead. Other than that, if your game gives players tools, this will kick them, I would suggest a different method.
hints still work tho.
yet hopperbins are still used.
Hello! Sorry to inform you, but moderation has been started against this question. The reason is simple. You made a duplicate of this question: https://scriptinghelpers.org/questions/111423/ In the future, refrain from posting duplicated. Thanks
I want help not moderation, they are both different scripts since I was advised to rewrite the entire script.
It is a continuation from the previous post.
Also, the group ID shouldn't really matter as the script is supposed to work even if I am not in the group.