Ok, for 1 sorry for not a very descriptive title. But basically im trying to match a plays inventory to a list of prohibited items, so a players inventory can be scanned. And this is what ive dont so far.
local Player = Players:GetPlayerFromCharacter(hit.Parent)
local Inventory = Player.Backpack
local ItemsInInventory = Inventory:GetChildren()
local prohibitedItems = {game.ServerStorage.ProhibitedItems["SR-60 Default"], game.ServerStorage.ProhibitedItems.CombatKnife}
for i, v in pairs(ItemsInInventory)do
for I,V in pairs(prohibitedItems) do
if v.Name == V.Name then
print("IllegalItemFound")
IllegalItemFound = "true"
end
end
end
However whenever I run this, even if there are no items at all in a players inventory the game will always print "IllegalItemsFound." Yea im not sure whats going on here because ive used a similar scipt in another project and it worked fine there. (fyi, I do have this code wrapped inside a function so I can call it when I need to)

2 comments
might be because v.name = v.name you might want to reference the actual item in the table either using the string name v.name == prohibitedItems["SR-60 Default"]
yeah, try renaming the for loop for retrieving inventory items to something else like "Inv_Items"