Okay so got help with this earlier but got a new problem with this.
Im using this script to give a reward at a specifik lvl.
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
But now if i want it to give a wand to a sorcerer and a axe to a knight do i need to make 2 new scripts to give that? Or is it possible to make this script give knight his items and mages there items at the same lvl?
And what change do i make to the script if i would like it to give items at more then one level?
If you are a nice guy you can tell me how and what you changed so i can learn this shit, trying to learn by trying around but not the easyest.
(sry for bad english
)
Im using this script to give a reward at a specifik lvl.
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
But now if i want it to give a wand to a sorcerer and a axe to a knight do i need to make 2 new scripts to give that? Or is it possible to make this script give knight his items and mages there items at the same lvl?
And what change do i make to the script if i would like it to give items at more then one level?
If you are a nice guy you can tell me how and what you changed so i can learn this shit, trying to learn by trying around but not the easyest.
(sry for bad english
Last edited: