[1248] = {potion = 2268<<<< the id of key ring?, cost = 6500<<< change it to 10 platinums , backpack_id = 2003<<< whant bp?, charges = 0},
u cant do that o0?
doPlayerAddItem(cid, 1111, 1)
local c = {
item = 5801,
cost = 10000,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerMoney(cid) >= c.cost) then
if (item.itemid == 1945) then
doTransformItem(item.uid, 1946)
doPlayerAddItem(cid, c.item, 1)
doPlayerRemoveMoney(cid, c.cost)
elseif (item.itemid == 1946) then
doTransformItem(item.uid, 1945)
end
else
doPlayerSendCancel(cid, "You do not have enough money.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
[ACTION_ID] = { id = XXXX, count = 1, cost = 1000 },
[ACTION_ID] = { id = XXXX, count = 1, cost = 1000 }
}
local v = cfg[item.actionid]
if(getPlayerMoney(cid) < v.cost) then
doPlayerSendCancel(cid, "You need " .. v.cost .. " gold.")
local shop_items = doCreateItemEx(v.id, v.count)
elseif(doPlayerAddItemEx(cid, shop_items, true) ~= RETURNVALUE_NOERROR) then
doPlayerSendCancel(cid, "You do not have enough capacity or space to carry this item.")
else
doPlayerRemoveMoney(cid, v.cost)
doCreatureSay(cid, getItemNameById(v.id) .. "!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
end
return true
end
[26/03/2010 13:08:40] [Error - Action Interface]
[26/03/2010 13:08:40] data/actions/scripts/runes.lua:onUse
[26/03/2010 13:08:40] Description:
[26/03/2010 13:08:40] data/lib/050-function.lua:23: 'for' limit must be a number
[26/03/2010 13:08:40] stack traceback:
[26/03/2010 13:08:40] data/lib/050-function.lua:23: in function 'doPlayerGiveItemContainer'
[26/03/2010 13:08:40] data/lib/050-function.lua:44: in function 'doPlayerBuyItemContainer'
[26/03/2010 13:08:40] data/actions/scripts/runes.lua:30: in function <data/actions/scripts/runes.lua:23>
[26/03/2010 13:08:55] [Error - Action Interface]
[26/03/2010 13:08:55] data/actions/scripts/runes.lua:onUse
[26/03/2010 13:08:55] Description:
[26/03/2010 13:08:55] (luaDoCreateItemEx) Item not found