Oh wait a minute, this script wont work. This is the fixed version:
function onUse(cid, item, frompos, item2, topos)
local t = {
[5000] = {itemId = 5000, storage = 5000, msg = "You have found an item!"},
[5001] = {itemId = 5001, storage = 5001, msg = "You have found a weapon!"}...