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

Reward at level (Need help)

denkan97

Well-Known Member
Joined
Dec 27, 2011
Messages
327
Solutions
2
Reaction score
50
So need some help with this...


function onAdvance(cid, skill, oldlevel, newlevel)
if newlevel >= 150 and getCreatureStorage(cid, 44923) == -1 then
doCreatureSetStorage(cid, 44923, 1)
doPlayerAddItem(cid, 7458, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've just recieved mammoth set for reaching level 150!")
end
return true
end

Now this works fine for me but i would like it to give me 4-5 different items inside a backpack.
For example i want it to give me a blue backpack with the items i need in it.
 
Solution
just edit the {itemid = xxxx, count = yyyy} (insert as many as you want, make sure to use commas inbetween each table)
Lua:
local items = {
    {itemid = 7458, count = 1},
    {itemid = xxxx, count = yyyy}
}

local bagId = 2000

function onAdvance(cid, skill, oldlevel, newlevel)
    if newlevel >= 150 and getCreatureStorage(cid, 44923) == -1 then
        local bag = doPlayerAddItem(cid, bagId)
        for _, item in ipairs(items) do
            doAddContainerItem(bag, item.itemid, item.count)
        end
        doCreatureSetStorage(cid, 44923, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've just recieved mammoth set for reaching level 150!")
    end
    return true
end
just edit the {itemid = xxxx, count = yyyy} (insert as many as you want, make sure to use commas inbetween each table)
Lua:
local items = {
    {itemid = 7458, count = 1},
    {itemid = xxxx, count = yyyy}
}

local bagId = 2000

function onAdvance(cid, skill, oldlevel, newlevel)
    if newlevel >= 150 and getCreatureStorage(cid, 44923) == -1 then
        local bag = doPlayerAddItem(cid, bagId)
        for _, item in ipairs(items) do
            doAddContainerItem(bag, item.itemid, item.count)
        end
        doCreatureSetStorage(cid, 44923, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've just recieved mammoth set for reaching level 150!")
    end
    return true
end
 
Solution
just edit the {itemid = xxxx, count = yyyy} (insert as many as you want, make sure to use commas inbetween each table)
Lua:
local items = {
    {itemid = 7458, count = 1},
    {itemid = xxxx, count = yyyy}
}

local bagId = 2000

function onAdvance(cid, skill, oldlevel, newlevel)
    if newlevel >= 150 and getCreatureStorage(cid, 44923) == -1 then
        local bag = doPlayerAddItem(cid, bagId)
        for _, item in ipairs(items) do
            doAddContainerItem(bag, item.itemid, item.count)
        end
        doCreatureSetStorage(cid, 44923, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You've just recieved mammoth set for reaching level 150!")
    end
    return true
end

Thx works fine :)
 
Do you know how many requests is allowed to make on a day? Got another one :rolleyes:
You can make as many threads as you want, as long as they are not duplicates.
Make sure your including as much information as possible when submitting each request thread.
Bumping rules for threads is once per 24 hours.
 
You can make as many threads as you want, as long as they are not duplicates.
Make sure your including as much information as possible when submitting each request thread.
Bumping rules for threads is once per 24 hours.
okay thx for info
 
Back
Top