• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reward On Reaching a Certain level

ok man. don't worry with that just explain me why the itens don't appears, any message im startup appears. And the character who reached the lvl don't appears any message too
 
Sorry, but this script didn't work correctly.
I just modified the level, and i reached it and didn't give to me anything. But, no errors on Console. What should it be?
 
it does work, If u didn't add everything it won't work.
If there is no error's there is always a human error.
 
First of all, the item of an level didn't exist, so i changed it, then i didn't registered on Login.Lua, now i registered, but nothing happened.

Take a look on my script:
local prizes = {
[60001] = {level = 104, reward = {9971, 1}},
[60002] = {level = 106, reward = {7408, 1}},
[60003] = {level = 108, reward = {{7958, 1}, {2157, 100}}},
}

function onAdvance(cid, skill, oldlevel, newlevel)
if(skill ~= SKILL__LEVEL)then return TRUE end
for i,t in ipairs(prizes) do
if not(getPlayerStorageValue(cid, i)) and t.level <= newlevel then
if type(t.reward[1] ~= "table") then
local add = doPlayerAddItem(cid, t.reward[1], t.reward[2])
if add then
doPlayerSendTextMessage(cid, 19, "You have received "..t.reward[2].." "..getItemNameById(t.reward[2]).." due to reaching level "..t.level..".")
setPlayerStorageValue(cid, i, true)
end
else
local bp = doCreateItemEx(1988, 1)
for _,item in ipairs(t.reward) do
doAddContainerItem(bp, item[1], item[2])
end
local add = doPlayerAddItemEx(cid, bp)
if add then
doPlayerSendTextMessage(cid, 19, "You have received backpack with items due to reaching level "..t.level..".")
setPlayerStorageValue(cid, i, true)
end
end
end
end
return TRUE
end

I didn't modified anything on script, just the config.
And don't show console errors. :S

What should be? Thanks.
 
Back
Top Bottom