-- credits to EvulMastah, i ask him because i get confused with the loop
local cfg = {
[action] = { item1, item2, item3, item4 }
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local it = cfg[item.actionid]
if(not(it))then
return false
end
for i = 1, #it do
if(item.itemid == it[i])then
local new = (i == #it and 1 or i + 1)
doTransformItem(item.uid, it[new])
break
end
end
return true
end