spice
CABS ARE HERE
Hello, I tried to make a script. This is how it should work:
1, The player that have the vocation ID 1,2,3 level up to 120.
2, At level 120, the exp will be set to 0.
3, When they get the level 120 promotion, their new vocation ID will be 4,5 or 6. Then they have the normal exp back,(the right one in the stages).
I have talked with some scripters, and they say that i should use:
But when I look in the LUA_FUNCTIONS there is not anything like that. What should I use?
This is the code I have right now:
1, The player that have the vocation ID 1,2,3 level up to 120.
2, At level 120, the exp will be set to 0.
3, When they get the level 120 promotion, their new vocation ID will be 4,5 or 6. Then they have the normal exp back,(the right one in the stages).
I have talked with some scripters, and they say that i should use:
Code:
doPlayerSetExperience(cid, 0)
But when I look in the LUA_FUNCTIONS there is not anything like that. What should I use?
This is the code I have right now:
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
if (getPlayerLevel(cid) >= 120) then
if isArcher(cid) then
doPlayerSendTextMessage(cid, 22, "You have now reached level 120. To be able to get more exp you have to buy the next promotion.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
doPlayerSetExperience(cid, 0)
elseif isWarrior(cid) then
doPlayerSendTextMessage(cid, 22, "You have now reached level 120. To be able to get more exp you have to buy the next promotion.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
doPlayerSetExperience(cid, 0)
elseif isMage(cid) then
doPlayerSendTextMessage(cid, 22, "You have now reached level 120. To be able to get more exp you have to buy the next promotion.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
doPlayerSetExperience(cid, 0)
end
return True
end
Last edited: