This should should only print "yes" if its not in the blacklist table, but it prints "yes" for everything even if in the blacklist table.
local blacklist = {242230929, 320742188}
function ifAllowed(id)
for i = 1, #blacklist do
if blacklist[i] ~= id then
return true
else
return false
end
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
--print(msg)
if checkRank(player) then
if msg == "/skip" then
songPlaying = false
getSong()
elseif string.sub(msg, 1, 7) == "/music " then
local d = string.sub(msg, 8, string.len(msg))
local validId = market:GetProductInfo(d)
if validId.Created and validId.AssetTypeId == 3 then
if ifAllowed(d) then
print("yes")
else
print("no")
end
end
end
end
end)
end)

1 comment
Did you check both values in the table because from what I see the problem is most likely that you have the for loop in a way that it can only return true if the very first value in the table is the id