local cfg{
level = 20,
text = "You have been automaticly promoted for reaching level " .. level .. "!"
}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL and newLevel >= cfg.level and oldLevel < cfg.level then
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, cfg.text)
end
return true
end
<event type="advance" name="autopromo" event="script" value="promo.lua"/>
registerCreatureEvent(cid, "autopromo")
LUA:local cfg{ level = 20, text = "You have been automaticly promoted for reaching level " .. level .. "!" } function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__LEVEL and newLevel >= cfg.level and oldLevel < cfg.level then doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, cfg.text) end return true end
XML:<event type="advance" name="autopromo" event="script" value="promo.lua"/>
And in login.lua
LUA:registerCreatureEvent(cid, "autopromo")
Bad command, you should use this:LUA:doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
LUA:setPlayerPromotionLevel(cid, 1)
Beside this didn't worked out:Bad command, you should use this:LUA:doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
LUA:setPlayerPromotionLevel(cid, 1)
setPlayerPromotionLevel(cid, 1)
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)