Didn't work, but got it to fix, thank you
People who looking for it here it is
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 8304 then
rand = math.random(1,1)
if(isInArray({1, 2, 3, 4}, getPlayerVocation(cid)))then
doPlayerAddSpentMana(cid, 4100)
doRemoveItem(item.uid,1)...