• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Desintegrate Rune

IgoR lYCAN

New Member
Joined
Dec 1, 2018
Messages
169
Reaction score
4
How to make it doenst work in itens with uniqueID?

Lua:
local dead_human = {
    3058, 3059, 3060, 3061, 3064, 3065, 3066
}

function onCastSpell(creature, variant, isHotkey)
    local position = Variant.getPosition(variant)
    local tile = Tile(position)
    local targetItem = tile and tile:getItems()

    if targetItem then
        local desintegrate = false
        for i, v in pairs(targetItem) do
            if (v:isItem() and
                isMoveable(v:getUniqueId())) then
                v:remove()
                desintegrate = true
            end
        end

        if desintegrate then
            position:sendMagicEffect(CONST_ME_POFF)
            return true
        end
    end

    creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    creature:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
end
 
Back
Top