• 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!

Mana Potions Turn Into Yellow Gems After Use.

Potions.lua



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 = 50000, backpack_id = 2000}, -- great health potion

[5004] = {potion = 7620, cost = 2500, backpack_id = 2001}, -- mana potion
[5005] = {potion = 7589, cost = 5000, backpack_id = 2001}, -- string mana potion
[5006] = {potion = 7590, cost = 10000, backpack_id = 2001}, -- great mana potion
[5007] = {potion = 8473, cost = 50000, backpack_id = 2000}, -- ultimate health potion
[5008] = {potion = 8472, cost = 50000, backpack_id = 2000}, -- great spirit 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






I also have on called PotionCharges.lua
 
Back
Top