function onUse(cid, item, frompos, item2, topos)
local t = {
[5000] = {itemId = 5000, storage = 5000, msg = "an item!"},
[5001] = {itemId = 5001, storage = 5001, msg = "a weapon!"},
[5002] = {itemId = 5002, storage = 5002, msg = "a shield!"},
[5003] = {itemId = 5003, storage = 5003, msg = "a ring!"},
[5004] = {itemId = 5004, storage = 5004, msg = "a helmet!"},
[5005] = {itemId = 5005, storage = 5005, msg = "a necklace!"},
[5006] = {itemId = 5006, storage = 5006, msg = "a quest!"}
}
local ActionId, storage = t[item.actionid], getPlayerStorageValue(cid, t.storage)
if ActionId and storage == -1 then
doPlayerAddItem(cid, t.itemId, 1)
doPlayerSendTextMessage(cid, 22, "You have found "..t.msg.."")
setPlayerStorageValue(cid, t.storage, 1)
else
doPlayerSendCancel(cid, "It\'s empty")
end
return true
end