Hey there, so awhile ago I thought this worked, but I now see that it does not.
When a player in my game rebirths, their pets’ upgrades get reset to 0, and I thought I had figured it out, but it isn’t actually doing anything.
All items would show up in the table like this example:
Table
_G.petUpgradeAmount[player.userId]
An item that would appear in the table
["CatPet"] = 0
I am trying to reset them all through this code
for i, ITEM in pairs(_G.petUpgradeAmount[player.userId]) do
_G.petUpgradeAmount[player.userId][ITEM] = 0
print(_G.petUpgradeAmount[player.userId][ITEM])
end
For some reason the print statement always prints 0, but then I print the whole table after the for loop, and they aren’t changed at all.
Does anyone know why this is the case?