local bronze = {7463, 7464, 7457, 3973, 7458, 7342, 9811, 9817, 9810, 9822} --items that randomly generated--
local silver = {2358, 7730, 2656, 2663, 10521, 2542, 9811, 9817, 9810, 9822}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local count = 1
if item.itemid == 1987 then --item of the bronze chest you want to use--
local randomChance = math.random(1, 10)
doPlayerAddItem(cid, bronze[randomChance], 1)
elseif item.itemid == 1996 then --item of the silver chest you want to use--
local randomChance = math.random(1, 10)
doPlayerAddItem(cid, silver[randomChance], 1)
end
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid, 1)
return TRUE
end