anti-push

mail@pastecode.io avatar
unknown
plain_text
6 months ago
758 B
0
Indexable
Never
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)

Leave a Comment