Hey.
I have problem with script for enchant HoTA by lever. When i put only helmet and when I push the lever then helmet disappears.
I don't know what can be wrong.
I have problem with script for enchant HoTA by lever. When i put only helmet and when I push the lever then helmet disappears.
I don't know what can be wrong.
Code:
local config = {
[1] = {{x=299, y=439, z=8}, 2342},
[2] = {{x=299, y=440, z=8}, 2147}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for _, t in pairs(config) do
if getTileItemById(t[1], t[2]).uid == 0 then
return doPlayerSendCancel(cid, 'You doesn\'t put all items on tites.')
else
doRemoveItem(getTileItemById(t[1], t[2]).uid, 1)
doSendMagicEffect(t[1], CONST_ME_EXPLOSIONAREA)
end
end
doCreateItem(2343, 1, {x=299, y=439, z=8})
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end