I changed it up a small tad and I’ll try it now
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local whitelist = {112007483, 155746202}
repeat wait() until LocalPlayer.Character
repeat wait() until LocalPlayer:FindFirstChild("Backpack")
local Character = LocalPlayer.Character
local Backpack = LocalPlayer:WaitForChild("Backback")
-- AE Anti-Btools
Backpack.ChildAdded:Connect(function(Obj)
if Obj:IsA("HopperBin") then
for i,v in pairs(whitelist) do
if LocalPlayer.UserId == v then
print("Admin.")
else
LocalPlayer:Kick("AEL - EXPLOIT DETECTION - BTOOLS IS NOT PERMITTED")
end
end
end
end)
To achieve what you’re looking for, you can utilise the newly added table method table.find. It will check if the specified value is in an array and return its index if it is or nil
if it isn’t. Here is how you could use it:
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Backpack = LocalPlayer:WaitForChild("Backpack")
local Whitelist = {123, 456} -- change to your userid
Backpack.ChildAdded:Connect(function(Obj)
if Obj:IsA("HopperBin") then
if not table.find(Whitelist, LocalPlayer.UserId) then -- if player isn't on whitelist
LocalPlayer:Kick("BTools are not permitted")
end
end
end)
6 Likes
I’ll try that after I do this quick test.
So far it currently works but I haven’t tested it WITHOUT being whitelisted, which I’ll do now.
It works! Thank you so much!
2 Likes
also
serverside checks are better, they can make a anti-kick script for bypassing those.
u need to make the anti-exploit serverside. Or else it wont work