i added the runes levers so when i use it it gets a rune 20x not a 20 runes how i can fix that ..here is the script
Code:
-- Written by Ldrozd with Tairen's advice; do not delete it, you arent the creator
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = {
[1000] = {id = 7620, bp = 2001, cost = 1000, anim = 30},
[1001] = {id = 7589, bp = 2001, cost = 1600, anim = 30},
[1002] = {id = 7590, bp = 2001, cost = 2400, anim = 30},
[1003] = {id = 7618, bp = 1988, cost = 6200, anim = 29},
[1004] = {id = 7588, bp = 1988, cost = 2000, anim = 29},
[1005] = {id = 7591, bp = 1988, cost = 3800, anim = 29},
[1006] = {id = 8473, bp = 1988, cost = 6200, anim = 29},
[1008] = {id = 2269, bp = 1988, cost = 6200, anim = 29},
[1009] = {id = 2268, bp = 2003, cost = 4000, anim = 29},
[1010] = {id = 2278, bp = 1988, cost = 6200, anim = 29},
[1011] = {id = 2261, bp = 1988, cost = 2000, anim = 29},
[1012] = {id = 2305, bp = 1988, cost = 3000, anim = 29},
[1013] = {id = 2293, bp = 1988, cost = 4000, anim = 29},
[1014] = {id = 2313, bp = 1988, cost = 4000, anim = 29},
[1015] = {id = 2274, bp = 2002, cost = 3000, anim = 29},
[1007] = {id = 8472, bp = 1999, cost = 38000, anim = 28}
}
local actuallPotion = potion[item.actionid]
local weight = getItemWeightById(actuallPotion.id, 20) + getItemWeightById(actuallPotion.bp, 1)
if(getPlayerFreeCap(cid) >= weight) then
if getPlayerMoney(cid) >= actuallPotion.cost then
local bp = doCreateItemEx(cid, actuallPotion.bp, 1)
doAddContainerItem(bp, actuallPotion.id, 20)
if(doPlayerAddItemEx(cid, bp) ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You need more space in your container.")
else
doPlayerRemoveMoney(cid, actuallPotion.cost)
doSendMagicEffect(toPosition, actuallPotion.anim)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have bought backpack of "..getItemNameById(actuallPotion.id).."s for "..actuallPotion.cost.." gold coins.")
end
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You need "..actuallPotion.cost.." gold coins to buy these potions.")
end
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You need at least "..math.ceil(weight).." oz to buy this item.")
end
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 then
doTransformItem(item.uid, item.itemid-1)
else
return true
end
return true
end