anti-push

 avatar
unknown
plain_text
2 years ago
758 B
3
Indexable
local dropItems = { 3492 }
local dropDelay = 600

gpAntiPushDrop = macro(dropDelay , function ()
  antiPush()
end)

onPlayerPositionChange(function()
    antiPush()
end)

function antiPush()
  if gpAntiPushDrop:isOff() then
    return
  end

  local tile = g_map.getTile(pos())
  if tile then
    local thing = tile:getTopThing()
    if thing then
      for _, item in pairs(dropItems) do
        if item ~= thing:getId() then
            local dropItem = findItem(item)
            if dropItem then
              g_game.move(dropItem, pos(), 1)
            end
        end
      end
    end
  end
end

addIcon("gpAntiPushDrop", {item=3492, text="Anti Push"}, function(icon, isOn)
    gpAntiPushDrop.setOn(isOn)
    end)

Editor is loading...
Leave a Comment