I have no clue why this doesn't work for me, but what I have is a loop inside a loop. So, the first loop is to get the children of game.Players and the next loop is to get the children of the backpack of said children, but it doesn't seem to work.
I have placed prints throughout to see what is going wrong, including some pcalls aswell, but nothing has helped. Script Analysis has not worked either.
What gets printed
Loaded.
Loaded
Hasnt messed up yet
Still good!
Checking (x2)
1
The code
print'Loaded'
print'Hasnt messed up yet'
function checkTools()
print'Checking'
for i,v in pairs(game.Players:GetChildren()) do
print'1'
repeat wait() until v.Backpack
for u,x in pairs(v.Backpack:GetChildren()) do
print'2'
if not x:FindFirstChild("Exempt") then
print'3'
v:Kick()
warn"Exploit Detected or this system doesn't really work!"
end
end
end
end
print'Still good!'
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Backpack
local success,msg = pcall(checkTools)
if success then
else
print(msg)
end
end)
local success,msg = pcall(checkTools)
if success then
else
print(msg)
end
for i,v in pairs(game.Players:GetPlayers()) do
v.Chatted:connect(function(msg)
if v:GetRankInGroup(3026610) >= 52 then
if msg == "checkTools" then
local success,msg = pcall(checkTools)
if success then
else
print(msg)
end
end
end
end)
end
while wait(60) do
local success,msg = pcall(checkTools)
if success then
else
print(msg)
end
end
Any help is appreciated, thank you.
