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

Lua Edit This To Not Give Backpack

Alyhide

Banned User
Joined
Aug 21, 2010
Messages
1,945
Reaction score
55
Location
Switzerland
Can somone edit this to not give a backpack full of runes, just 1 rune?

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 = 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
 
One rune with stacked runes or just one single rune even if you purchase for more than one?

Just 1 single rune.
It really gives potions, but im going to edit it to give runes, but runes are infin, so they dont need an entire bp xD

Anyone?
 
Last edited by a moderator:
Why does the user need to acquire a backpack if the only need one rune?

if that is really want to you want i will write the code.
 
Why does the user need to acquire a backpack if the only need one rune?

if that is really want to you want i will write the code.

The name of the post is "Edit This To Not Give Backpack." -.- I'm trying to get someone to edit it just to give them a single rune, and NO backpack.
 
LUA:
local t = {
    [5001] = {7618, 1000}, -- health potion
    [5002] = {7588, 2500}, -- strong health potion
    [5003] = {7591, 50000}, -- great health potion
 
    [5004] = {7620, 2500}, -- mana potion
    [5005] = {7589, 5000}, -- string mana potion
    [5006] = {7590, 10000}, -- great mana potion
    [5007] = {8473, 50000}, -- ultimate health potion
    [5008] = {8472, 50000}, -- great spirit potion
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local a = t[item.uid]
    if doPlayerBuyItem(cid, a[1], 1, a[2], 1) == TRUE then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a "..getItemNameById(a[1]).." for "..a[2].." gold coins.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..a[2].." gold coins for a "..getItemNameById(a[1])..".")
    end
    return TRUE
end
wasn't that hard
 
Back
Top