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

How change count for buy

Exactly

New Member
Joined
Jul 14, 2014
Messages
117
Reaction score
4
Hello, i need change for one items buy, now get bp and potions

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local container = 0
    local cost = 10000 --ile ma kosztowac bp np runek
    local rune_id = 7439 --id runki, mozna zmienic na potion_id
    local backpack_id = 1996 --id backpacka
    if(item.itemid == 9827) then
        if(doPlayerRemoveMoney(cid, cost) == TRUE) then
            doTransformItem(item.uid, item.itemid+1)
            container = doPlayerAddItem(cid, backpack_id, 1)
            for i = 1, 20 do
                doAddContainerItem(container, rune_id, 1)
            end
        else
            doPlayerSendCancel(cid,"Sorry, you don't have enough money.")
        end
    elseif(item.itemid == 9828) then
        doTransformItem(item.uid, item.itemid-1)
    end
return TRUE
end

THANKS !
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cost = 10000 --ile ma kosztowac bp np runek
    local rune_id = 7439 --id runki, mozna zmienic na potion_id
    if item.itemid == 9827 then
        if doPlayerRemoveMoney(cid, cost) then
            doTransformItem(item.uid, item.itemid+1)
            doPlayerAddItem(cid, rune_id, 20)
        else
            doPlayerSendCancel(cid,"Sorry, you don't have enough money.")
        end
    elseif item.itemid == 9828 then
        doTransformItem(item.uid, item.itemid-1)
    end
    return true
end
 

Similar threads

Back
Top