Okay, so, lets say the players inventory is this.
local weapons = { ["Fists"] = {"0_Normal",3,"BackBreaker"}, ["Degreaser"] = {"1_Unique",1,"Flamer"}, ["Golden Frying Pan"] = {"2_Vintage",3,mostclass}, ["Bloxxy Award"] = {"3_Genuine",3,allclass}, }
It works fine, but the problem arises when the player finds, say, another degreaser in Unusual quality.
local weapons = { ["Fists"] = {"0_Normal",3,"BackBreaker"}, ["Degreaser"] = {"1_Unique",1,"Flamer"}, ["Golden Frying Pan"] = {"2_Vintage",3,mostclass}, ["Bloxxy Award"] = {"3_Genuine",3,allclass}, ["Degreaser"] = {"5_Unusual",1,"Flamer"}, }
The original degreaser gets overwritten. Despite this, the game never actually gets "Degreaser", it uses a i,v loop instead and has the slot write the name of it (to copy over to the inventory)
for i,v in pairs(weapons) do -- copies stuff over from a button a.MouseButton1Click:Connect(function() if game.ReplicatedStorage.Weapons:FindFirstChild(i) then --checks if it's the proper class type plr.Slots["S" .. v[2]].Value = game.ReplicatedStorage.Weapons:FindFirstChild(i) --This is the part that changes the slot's item. --refresh character goes here end end) end
Would it be possible to make it so there can be multiple qualities of weapons? (And multiple of the same weapon in the same inventory.)