• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[8.6] Proper amount of potions

MrDamiano

New Member
Joined
Feb 3, 2013
Messages
14
Reaction score
0
Hello, i have a little problem with this script for lever bp of potions, what do i need to add to get 20 potions instead of only one ?
Code:
local config = {
[5001] = {potion = 7618, cost = 1000, backpack_id = 2000}, -- health potion
[5002] = {potion = 7588, cost = 2500, backpack_id = 2000}, -- strong health potion
[5003] = {potion = 7591, cost = 5000, backpack_id = 2000}, -- great health potion

[5004] = {potion = 7620, cost = 5000, backpack_id = 2001}, -- mana potion
[5005] = {potion = 7589, cost = 5000, backpack_id = 2001}, -- string mana potion
[5006] = {potion = 7590, cost = 5000, backpack_id = 2001}, -- great mana potion
} -- config end --

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) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a backpack "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a backpack "..getItemNameById(potion.potion)..".")
end
return TRUE
end

Thanks
 
Back
Top