Small issue with a table

Trying to see if the local player’s user id is not equal to the 2 ids I have in a table. It kicks me even though my ID is the first in the table. Its annoying since its so incredibly simple but just cant seem to find what’s wrong.

Table:

local admins = {
	219993365,
	472072511
}

Kick:

adminGUI.Changed:Connect(function(p)
	if localPlayer.UserId ~= admins[1] or localPlayer.UserId ~= admins[2] then
		localPlayer:Kick("Tampering detected. '"..p.."'")
	end
end)

Full script:

local localPlayer = game:WaitForChild("Players").LocalPlayer
local playerScripts = localPlayer.PlayerScripts
local espLocal = playerScripts:WaitForChild("espLocalScript")
local antiCheatDecoy = playerScripts:WaitForChild("antiCheat")
local CrimesFolder = localPlayer:WaitForChild("CrimesFolder")
local arsonBool = CrimesFolder:WaitForChild("arsonBool")
local armedRobBool = CrimesFolder.armedRobBool
local assultBool = CrimesFolder.assultBool
local briberyBool = CrimesFolder.briberyBool
local cyberCrimeBool = CrimesFolder.cyberCrimeBool
local firearmsOffenceBool = CrimesFolder.firearmsOffenceBool
local firstDegMurderBool = CrimesFolder.firstDegMurderBool
local fraudBool = CrimesFolder.fraudBool
local secondDegMurderBool = CrimesFolder.secondDegMurderBool
local thirdDegMurderBool = CrimesFolder.thirdDegMurderBool
local tresspassingBool = CrimesFolder.tresspassingBool
local adminGUI = localPlayer.PlayerGui:WaitForChild("adminGUI")
local playerGUI = localPlayer.PlayerGui
local giveLocalPlayerAdmin = game.ReplicatedStorage.eventsFolder.giveLocalPlayerAdmin
local backpack = localPlayer.Backpack
local admins = {
	219993365,
	472072511
}
local function onDescendantRemoved()
	localPlayer:Kick("Tampering detected.")
end
local function onDescendantAdded()
	localPlayer:Kick("Tampering detected.")
end
local function onAttributeChanged()
	localPlayer:Kick("Tampering detected.")
end


game.Lighting.DescendantAdded:Connect(onDescendantAdded)
game.Lighting.DescendantRemoving:Connect(onDescendantRemoved)
game.Lighting.Changed:Connect(function(p)
	localPlayer:Kick("Tampering detected. "..p.." changed.")
end)
game.Players.Changed:Connect(function(p)
	localPlayer:Kick("Tampering detected. "..p.." changed.")
end)
giveLocalPlayerAdmin.OnClientEvent:Connect(function()
	localPlayer:Kick("Tampering detected. Event fired.")
end)
playerGUI.DescendantAdded:Connect(function(descendant)
	if descendant:IsA("ScreenGui") then
		wait(1)
		if descendant.Name == "RemoteSpy" then
			localPlayer:Kick("Tampering detected. "..descendant.Name.." found.")
		end
	end
end)
backpack.DescendantAdded:Connect(function(descendant)
	if descendant.Name == "Hammer" or descendant.Name == "hammer" or descendant.Name == "HAMMER" or descendant.Name == "Clone" or descendant.Name == "clone" or descendant.Name == "CLONE" or descendant.Name == "Grab" or descendant.Name == "grab"  or descendant.Name == "GRAB" then
		localPlayer:Kick("Tampering detected. Btools detected.")
	end
end)

adminGUI.Changed:Connect(function(p)
	if localPlayer.UserId ~= admins[1] or localPlayer.UserId ~= admins[2] then
		localPlayer:Kick("Tampering detected. '"..p.."'")
	end
end)


local getChildren1 = script.Parent.Parent:GetChildren()

wait(7)


for _, children in getChildren1 do
	if children:IsA("Folder") then
		children.DescendantRemoving:Connect(onDescendantRemoved)
	end
end

localPlayer.Character.DescendantRemoving:Connect(function(descendant)
	if descendant:IsA("Folder") then
		localPlayer:Kick("Tampering detected")
	end
end)







2 Likes

if localPlayer.UserId ~= admins[1] or localPlayer.UserId ~= admins[2] then
There is an OR between these two statements meaning if one of them returns true, it would pass the check and since you are comparing with 2 ids one of them will return true and the other one false and continue to the next thread

instead what you can do is use table.find(tablename,value)

here’s how you utilize it in your script:

 adminGUI.Changed:Connect(function(p)
	if not table.find(admins,localPlayer.UserId) then
		localPlayer:Kick("Tampering detected. '"..p.."'")
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.