Untitled

 avatar
unknown
plain_text
a year ago
747 B
5
Indexable
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.uid == 0 or item.itemid == 0 then return false end
    toPosition.stackpos = 255
    if item.uid == 0 or item.itemid == 0 then return false end
    toPosition.stackpos = 255

    local nam = getItemName(itemEx.uid)
    local newNam, count = nam:gsub("%s*%[.-%]","", 1) -- Eliminar solo la primera mejora encontrada en el nombre del item

    if count > 0 then
        doSendMagicEffect(toPosition, 30)
        doItemSetAttribute(itemEx.uid, 'name', newNam)
        doRemoveItem(item.uid, 1)
        return true
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "El item no tiene más mejoras para eliminar.")
        return false
    end
end
Editor is loading...
Leave a Comment