• 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!

fast need help :/

Il Knight

Veteran OT User
Joined
Dec 1, 2014
Messages
676
Solutions
7
Reaction score
350
Location
Spain
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
 
i need to do something like this
21:48 You see a crystal.
Item ID: 2264, Action ID: 456322 < (the id of the database)
Position: 1009, 1010, 7
 
Back
Top