Code: Select all
local count = 0
local total = 0
if global.eqChests ~= nil then
game.player.print("global isn't nil")
for k,eqChest in pairs(global.eqChests) do
total = total + 1
if eqChest[5] == nil then
count = count + 1
eqChest[5] = eqChest[1].surface
end
end
end
game.player.print("updated "..count.."/"..total.." chests")