Code: Select all
if event.created_entity.type == "boiler" and event.created_entity.fluid_box.filter == "water" then
event.created_entity.insert_fluid({name = "water", amount = 10})
end
script.on_event(defines.events.on_built_entity, on_built_entity)
script.on_event(defines.events.on_robot_built_entity, on_built_entity)