Il Knight
Veteran OT User
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isMonster(itemEx) then
return true
end
if (math.random(1,100) <= 50) then
local c = Monster(itemEx)
local id = db.getResult("SELECT `id` FROM `customc` WHERE `mid` =(" .. c:getId(itemEx) .. ");")
local item = Game.createItem(2264)
item:setAttribute(ITEM_ATTRIBUTE_ACTIONID, id)
else
doRemoveItem(item.uid, 1)
end
return true
end
the ID on the database its numbers like 293287
ERROR atemt to index local 'id' a (number value)
how i can solve this?
thanks in advance
if not isMonster(itemEx) then
return true
end
if (math.random(1,100) <= 50) then
local c = Monster(itemEx)
local id = db.getResult("SELECT `id` FROM `customc` WHERE `mid` =(" .. c:getId(itemEx) .. ");")
local item = Game.createItem(2264)
item:setAttribute(ITEM_ATTRIBUTE_ACTIONID, id)
else
doRemoveItem(item.uid, 1)
end
return true
end
the ID on the database its numbers like 293287
ERROR atemt to index local 'id' a (number value)
how i can solve this?
thanks in advance