#Immediately breaks Gem Soils in inventory, maxBlocks = 40, minHits = 4

2 messages · Page 1 of 1 (latest)

pulsar pivot
#

function breakBlocks(targetBlock, maxBlocks, minHits)
  client:on("presend", function(message)
      local amount = client:inventory():count(targetBlock, InventoryItemType.block)
      local clientPoint = client:point()
      local tilePoint = Vector2i.new(clientPoint.x - 1, clientPoint.y)
      
      local blocks = math.min(amount, maxBlocks)
      for i = 1, blocks do
          client:place(tilePoint, targetBlock, InventoryItemType.block)
          for j = 1, minHits do
              client:send("HB", { x = tilePoint.x, y = tilePoint.y })
          end
      end
  end)
end

-- Immediately breaks Gem Soils in inventory, maxBlocks = 40, minHits = 4
-- However client disconnects, so you would want to connect your game client manually for efficiency.
breakBlocks(2735, 40, 4```
feral flower
#

@agile heart