mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
deconstruction of tree and rocks when drive over them
This commit is contained in:
@@ -97,3 +97,13 @@ Event.on_nth_tick(300, function()
|
|||||||
chache[key] = nil
|
chache[key] = nil
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Event.add(defines.events.on_entity_damaged, function(event)
|
||||||
|
if not (event.damage_type.name == 'impact' and event.force) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if event.entity.type == 'tree' or event.entity.type == 'simple-entity' then
|
||||||
|
event.entity.destroy()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user