local config = {
level = 50,
skill = SKILL__LEVEL,
item = 2160,
count = 5,
storage = 1337
}
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == config.skill and newlevel >= config.level and getPlayerStorageValue(cid, config.storage) < 1) then
setPlayerStorageValue(cid, config.storage, 1)
doPlayerAddItem(cid, config.item, config.count)
end
return true
end
save the script as data/creaturescripts/scripts/advance.luaAnd how do i add this? Actions?
<event type="advance" name="PlayerAdvance" event="script" value="advance.lua"/>
registerCreatureEvent(cid, "PlayerAdvance")
I have done everything you said but i won't work! And no errors in console :S Nothing seems to happend.
file that called Advande.
value="advances.lua"/>
local config = {
level = 50,
skill = SKILL__LEVEL,
item = 2160,
count = 5,
storage = 55885
}
function onAdvance(cid, skill, oldLevel, newLevel)
if(skill == config.skill and newLevel >= config.level and getPlayerStorageValue(cid, config.storage) == -1) then setPlayerStorageValue(cid, config.storage, 1)
doPlayerAddItem(cid, config.item, config.count)
end
return true
end