Hi.
Please change:
script.on_event(defines.events.on_built_entity, function(event)
entities_build(event)
end)
to:
script.on_event({defines.events.on_built_entity,defines.events.on_robot_built_entity, defines.events.script_raised_built,defines.events.script_raised_revive} function(event)
entities_build(event)
end)
Then add:
script.on_event(defines.events.on_entity_cloned,function(event)
event.created_entity=event.destination
entities_build(event)
end)
below it.
And remove (because double-up with new on_event):
script.on_event(defines.events.on_robot_built_entity, function(event)
entities_build(event)
end)
THANKYOU -_-