Remove the else part of the condition. You only want to check if there is a value that matches “map”, otherwise it would reset to false after checking another value.
map = false
for i,v in pairs(inventory:GetChildren()) do
if v.Value == "map" then
map = true
end
end