Hello, recently i’ve got a data issue when saving modules information into data, the problem is when I make an in pairs loop through out the module, I made it search for the item’s rarity and which rarity it has but when the item isnt in any rarity that is being searched on the module it doesn’t gives nil and instead we get an error.
We are trying to check if an index is inside another index or if they are not. It gives nil but it stops running instead of returning to nil.
This is the part of the script that is generating error
local newtab = {}
for i,v in pairs(knifeskinsDataStore:Get(DefaultSkins)) do
for sk, b in pairs (SkinsModule[“KnifeSkins”]) do
if v == “0” then
else
if sk[“Common”][v] == nil or sk[“Rare”][v] == nil or sk[“Epic”][v] == nil then
else
table.insert(newtab, v)
KnifeSkins.Value = KnifeSkins.Value…" ; "…v
end
end
end
end
v is the item name that we’re trying search in module, but we need to get the rarity index before the item. I’m asking for help because my team and I have been stopped by this problem and i can’t figure out a way to fix it. Feel free to ask any questions if i did not make it clear.