function onAdvance(cid, skill, oldLevel, newLevel)
if(skill == SKILL_LEVEL and newLevel >= 20 and oldLevel < 20) then
doPlayerSetVocation(cid, (getPlayerVocation(cid)+4))
doCreatureSay(cid, "You gained level 20 and have been promoted!", TALKTYPE_ORANGE_1)
end
end
<event type="advance" name="AutoPromo" event="script" value="promote.lua"/>
registerCreatureEvent(cid, "AutoPromo")