function onUse(cid, item, frompos, item2, topos)
id1 = 2123
id2 = 2648
id3 = 2112
if (item.itemid == id1) then
doPlayerRemoveItem(cid, id1, 1)
doPlayerRemoveItem(cid, id2, 1)
doPlayerAddItem(cid, id3, 1)
end
end
if (item.itemid == id1) then
if (item.itemid == id1 and item.itemid == id2) then
local id1 = 2123 -- ID of the first item.
local id2 = 2648 -- ID of the second item.
local id3 = 2112 -- ID of the final item.
function onUse(cid, item, frompos, item2, topos)
if item.itemid == id1 then
doPlayerRemoveItem(cid, id1, 1)
doPlayerSendTextMessage(cid,22,"Please use the next item.")
end
if item2.itemid == id2 then
doPlayerRemoveItem(cid, id2, 1)
doPlayerSendTextMessage(cid,22,"Congratulations! you received an [itemname].")
doPlayerAddItem(cid, id3, 1)
end
end
:C doesn't seem to be working says i cannot use that object when I click on it
toPosition.stackpos = toPosition.stackpos - 1
if getThingFromPos(toPosition).itemid == 2222 then
...