kamilcioo
Veteran OT User
- Joined
- Jul 25, 2008
- Messages
- 979
- Solutions
- 1
- Reaction score
- 291
Can someone edit my script to buy bag great spirit potion with 50 charges each
Code:
local config = {
[6000] = {potion = 8472, cost = 152000, backpack_id = 1996, charges = 50},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = config[item.uid]
if isInArray({1945, 1946}, item.itemid) ~= TRUE then
return TRUE
end
if doPlayerBuyItemContainer(cid, potion.backpack_id, potion.potion, 1, potion.cost, 1, potion.charges) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a bag "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a bag "..getItemNameById(potion.potion)..".")
end
return TRUE
end