Can someone please help me why does this behavior happen? it should be sorting it and assigning the slot to its current index
local inv = {}
local tab = {
Name = "TestWeapon",
Type = "Gear",
Class = "Weapon",
Slot = 0,
Stackable = false,
BaseStats = {
Power = 20,
AttackSpeed = 6,
}
}
local function sortSlot(curInv)
for i,v in pairs(curInv) do
v.Slot = i
end
return curInv
end
table.insert(inv, tab)
table.insert(inv, tab)
table.insert(inv, tab)
table.insert(inv, tab)
table.insert(inv, tab)
table.insert(inv, tab)
sortSlot(inv)
print(inv)
I dont know if i’m tripping or not because this behavior is messing with my inventory system
and this issue just appeared out of nowhere without apparent cause
It still doesnt work still the same result. my inventory system was working fine yesterday, but then this bug appeared and it’s messing with it and I cant find exactly what’s causing this behaviour
Same result, I really dont think i’m doing wrong in my code, it’s in roblox problem i guess, try to replicate it copy my code in a server script and run it