• 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] TFS 0.3.6 Problem with a potions

MrDamiano

New Member
Joined
Feb 3, 2013
Messages
14
Reaction score
0
Hi, I got a problem with potions on my server, when I buy for example 20 pots and use one of them all others potions get empty, I mean I can use only one of the 20 potions.

thats my potions.lua

Code:
local greatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

function onUse(cid, item, frompos, item2, topos)
    if(item.itemid == healthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, emptyPot)
    elseif(item.itemid == manaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, emptyPot)
    elseif(item.itemid == strongHealthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, strongEmptyPot)
    elseif(item.itemid == strongManaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, strongEmptyPot)
    elseif(item.itemid == greatHealthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, greatEmptyPot)
    elseif(item.itemid == greatManaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doTransformItem(item.uid, greatEmptyPot)
    end

    return TRUE
end


Have anyone any solution for this ? Will appreciate
 
Code:
local greatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

function onUse(cid, item, frompos, item2, topos)
    if(item.itemid == healthPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end

        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, emptyPot, 1)
    elseif(item.itemid == manaPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
       
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, emptyPot, 1)
    elseif(item.itemid == strongHealthPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
       
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, strongEmptyPot, 1)
    elseif(item.itemid == strongManaPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
       
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, strongEmptyPot, 1)
    elseif(item.itemid == greatHealthPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
       
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, greatEmptyPot, 1)
    elseif(item.itemid == greatManaPot) then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
       
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, greatEmptyPot, 1)
    end

    return TRUE
end
 
Code:
local greatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

function onUse(cid, item, frompos, item2, topos)
    if(item.itemid == healthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == manaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == strongHealthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == strongManaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == greatHealthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == greatManaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 500, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return true
        end
        doRemoveItem(item.uid, 1)
    end

    return true
end
 
Back
Top