local t = {
[6001] = {8001,"magic sword",2400},
[6002] = {8001,"demon armor",2494},
[6003] = {8001,"stonecutter axe",2431},
[6004] = {8001,"annihilation bear",2326}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
local v = t[item.uid]
if getPlayerStorageValue(cid,v[1]) == -1 and getPlayerFreeCap(cid) >= (getItemWeightById(v[3])) then
setPlayerStorageValue(cid,v[1],1)
doPlayerAddItem(cid,v[3])
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a " .. v[2] .. "!")
elseif getPlayerStorageValue(cid,v[1]) == 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty")
elseif getPlayerFreeCap(cid) < (getItemWeightById(v[3])) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need " .. getItemWeightById(v[3]) .. ".00 oz in order to get the item")
end
return true
end