This works for 1 item count lets say i want to make it remove 100 white pieces of cloth and 100 blue pieces of cloth... not 1 can you please help me im kinda confused 
Thanks! i rep++ 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
firstID = 5912 -- id of the first item
secondID = 5909 -- id of the second item
newID = 2307 -- id of the new item
count = 1 -- You get 1 of the new item
local piece1pos = {
x = 200,
y = 163, -- Position of the first item
z = 7,
stackpos=1}
local piece2pos = {
x = 198,
y = 163, -- Position of the second item
z = 7,
-----------------------------------------------------
stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
if item.itemid == 1945 then
doRemoveItem(getpiece1.uid,1)
doRemoveItem(getpiece2.uid,1)
doSendMagicEffect(piece1pos,2)
doSendMagicEffect(piece2pos,2)
doPlayerAddItem(cid,newID,count)
doSendMagicEffect(playerpos,14)
doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(newID) .. " " .. getItemNameById(newID) .. ".")
else
doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
end
else
doPlayerSendCancel(cid, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
end
return TRUE
end