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
Also register in login.lua and creaturescripts.xmlCode: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
<event type="advance" name="[B][COLOR="Red"]EventName[/COLOR][/B]" event="script" value="[B][COLOR="Red"]scriptname.lua[/COLOR][/B]"/>
registerCreatureEvent(cid, "[B][COLOR="Red"]EventName[/COLOR][/B]")
creaturescripts.xml
login.luaCode:<event type="advance" name="[B][COLOR="Red"]EventName[/COLOR][/B]" event="script" value="[B][COLOR="Red"]scriptname.lua[/COLOR][/B]"/>
Code:registerCreatureEvent(cid, "[B][COLOR="Red"]EventName[/COLOR][/B]")
creaturescripts.xml
login.luaCode:<event type="advance" name="[B][COLOR="Red"]EventName[/COLOR][/B]" event="script" value="[B][COLOR="Red"]scriptname.lua[/COLOR][/B]"/>
Code:registerCreatureEvent(cid, "[B][COLOR="Red"]EventName[/COLOR][/B]")
put in the login.lua wherever?
bump