function onUse(cid, item, fromPosition, itemEx, toPosition)
local box = {
[xxx] = {itemId = xxxx, name = "a dragon scale mail"},
[xxx] = {itemId = xxxx, name = "a pair of knight legs"}
}
local v = box[item.uid]
if(v) then
local p = Player(cid)
if(p:getStorageValue(49254) ~= 1) then
p:setStorageValue(49254, 1)
p:addItem(v.itemId, 1)
local item = Item(v.itemId)
p:sendTextMessage(MESSAGE_INFO_DESCR, "You have found " .. v.name .. ".")
else
p:sendTextMessage(MESSAGE_INFO_DESCR, "The chest is empty.")
end
end
return true
end