Guest User

Untitled

a guest
Feb 18th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | Source Code | 0 0
  1. script.on_event(defines.events.on_player_mined_entity, function(event)
  2.     local player_index = event.player_index
  3.     local player = game.players[player_index]
  4.     local entity = player.selected
  5.     if entity and entity.valid then
  6.         if entity.type == "linked-belt" then
  7.             local lbn = entity.linked_belt_neighbour
  8.             if lbn and lbn.surface == entity.surface then
  9.                 --Mark linked belt neighbour for deconstruction
  10.                 lbn.order_deconstruction(lbn.force, player)
  11.             end
  12.         end
  13.     end
  14.    
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment