function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 1337
local items = {
[5000] = {itemID = 2160, count = 100}, -- Chest UID = 5000
[5001] = {itemID = 2160, count = 57}, -- Chest UID = 5001
[5002] = {itemID = 2476, count = 1}, -- Chest UID = 5002
[5003] = {itemID = 2476, count = 1}, -- Chest UID = 5003
[5004] = {itemID = 2160, count = 100}, -- Chest UID = 5004
[5005] = {itemID = 2160, count = 100} -- Chest UID = 5005
}
if getPlayerStorageValue(cid, storage) <= 0 then
if items[item.uid].count == 1 then
doPlayerSendTextMessage(cid, 22, "You found a " .. getItemNameById(items[item.uid].itemID) .. ".")
else
doPlayerSendTextMessage(cid, 22, "You found " .. items[item.uid].count .. " " .. getItemNameById(items[item.uid].itemID) .. "s.")
end
doPlayerAddItem(cid, items[item.uid].itemID, items[item.uid].count)
setPlayerStorageValue(cid, storage, 1)
else
doPlayerSendCancel(cid, "You have already made this quest.")
end
return true
end