function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
local reward = 0
if item.actionid == 42361 then
reward = doCreateItemEx(8928,1)
elseif item.actionid == 42362 then
reward = doCreateItemEx(3798,1)
elseif item.actionid == 42363 then
reward = doCreateItemEx(7426,1)
elseif item.actionid == 42364 then
reward = doCreateItemEx(3962,1)
elseif item.actionid == 42365 then
reward = doCreateItemEx(8910,1)
elseif item.actionid == 42366 then
reward = doCreateItemEx(9504 ,1)
end
if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
setPlayerStorageValue(cid, 42361, 1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
end
end
return TRUE
end
Quest.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
local reward = 0
if item.actionid == 42361 then
reward = doCreateItemEx(8928,1)
elseif item.actionid == 42362 then
reward = doCreateItemEx(3798,1)
elseif item.actionid == 42363 then
reward = doCreateItemEx(7426,1)
elseif item.actionid == 42364 then
reward = doCreateItemEx(3962,1)
elseif item.actionid == 42365 then
reward = doCreateItemEx(8910,1)
elseif item.actionid == 42366 then
reward = doCreateItemEx(9504 ,1)
end
if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
setPlayerStorageValue(cid, 42361, 1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
end
end
return TRUE
end
<action fromaid="42361" toaid ="42366" event="script" value="quests/Quest.lua"/>
you cant actuallyif you know how the quest system works, you can all give them action id 2000 and the same unique id, put the items in the chests and you're done.