• 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!

Lua Promotion at lvl 20

Tul

New Member
Joined
Apr 19, 2011
Messages
60
Reaction score
0
PLEASE i need a script at lvl 20 change automatic vocation!

PLX FAST REP!
 
something like this?
-- in this example the file is named promote.lua --
Code:
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

in creaturescripts.xml:
Code:
<event type="advance" name="AutoPromo" event="script" value="promote.lua"/>

and in login.lua: (almost at the end, right b4 the return true)
Code:
registerCreatureEvent(cid, "AutoPromo")
 
only potential flaw is if you somehow got promotion before lvl 20 (possible on some servers), but otherwise should be flawless
 
Back
Top