function onUse(cid, item, fromPosition, itemEx, toPosition)
local key = doCreateItemEx(2087, 1)
if item.uid == 64520 then
if getPlayerStorageValue(cid,64520) == -1 then
doPlayerSendTextMessage(cid,25,"You have found a key.")
doSetItemActionId(key, 3520)
doPlayerAddItemEx(cid, key, 1)
setPlayerStorageValue(cid,64520, 1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end
end
return TRUE
end