seems following construct no longer works
Code: Select all
function on_player_died(event)
local player = game.players[event.player_index]
if player ~= nil then
for i = 1, #storeinventories, 1 do
local inventoryid = storeinventories[i]
local playerinventory = player.get_inventory(inventoryid)
for j = 1, #playerinventory, 1 do
if playerinventory[j].valid and playerinventory[j].valid_for_read then
local item = playerinventory[j]
--[[ do something here ]]--
end
end
end
end
end
mind this code was working in 0.14