this is my first Post and I hope its at the right place.
I try to make a mod and need your help.
I want to read and write the durability from tools
Code: Select all
chest = --<<--- is the placed chest
for item, count in pairs(chest.get_contents()) do
game.players[1].print(tostring(item)) --<<-----prints the name of the item like "iron-axe"
game.players[1].print(tostring(item.durability)) --<<---prints nil
end
https://forums.factorio.com/wiki/inde ... durability
My goal is atm to simulate a tool use in a chest so it will loose durability over time. Do someone know how to access the durability stat of an item?
Thanks for your help
Thunder