mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
deconstruction of tree and rocks when drive over them
This commit is contained in:
@@ -96,4 +96,14 @@ Event.on_nth_tick(300, function()
|
||||
for key, _ in pairs(chache) do
|
||||
chache[key] = nil
|
||||
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