• 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 set vocation not working as intended

miens

Combos and Freedom
Joined
Nov 6, 2016
Messages
61
Reaction score
8
Hello.
Using tfs 1.0. I am trying to set player vocation from script, more or less like the Oracle. It works - changes the voc to selected id. But after I log out my vocation goes back to what it was previously. To make it even more strange - profession is saved in database correctly. But still after relog character has no voc. What is happening?

I even tried The Oracle script originally attatched to server and it produces exactly the same results. Any ideas?

ps: using doPlayerSetVocation(player,2). Tried using player:setVocation but it always returns false.
ps2: checked on login and on logout fuction and didnt found anything malicious there.
 
fromVoc in vocations.xml has to be the same id as the vocation it correlates to
example:
fromId="2" for vocId="2"
 
Solution
yep that was it. Thanks :)

ps: strange. if from voc has to equal voc id then what's the point of having it?
 
wish i knew
Afaik, the fromvoc is used if a vocation is a promotion to a certain class. So if you would promote someone, you wouldn't change the vocation directly by using setVocation() but would promote automatically with self:promote() (no idea this function exists tho)
 
Back
Top