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

Change Vocations

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
188
Reaction score
9
GitHub
Jarek123
Hello guys I have problem when is ss (Restart server) and alone server change vocations for players Palladin to Master Sorcerer and from Master Sorcerer to Palladin
Where I have Looing for error?meybe somebody was have this same problem?

TFS 0.4 3777 Tibia 8.6
 
Hello guys I have problem when is ss (Restart server) and alone server change vocations for players Palladin to Master Sorcerer and from Master Sorcerer to Palladin
Where I have Looing for error?meybe somebody was have this same problem?

TFS 0.4 3777 Tibia 8.6
It's probably vocations.xml, that 'fromvoc'. If the vocation ID is different from 'fromvoc', for example, vocation ID is 5 for Master Sorcerer and 'fromvoc' is 3 for Paladin, when logout and login, you are back to 'fromvoc' 3, which is Paladin . You have to put the ID and 'fromvoc' with the same number to keep the vocations correct. It's settled
 
To integrate this vocation change script into your Tibia server, follow these steps:

  1. Create the Lua File: First, create a new Lua file in the data/talkactions/scripts/ directory of your server folder. Name it change_vocations.lua.
  2. Add the Script: Copy the Lua code from my previous response and paste it into change_vocations.lua.

change_vocations.lua.
function onSay(cid, words, param)
if getPlayerLevel(cid) < 8 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level 8 to change your vocation.")
return true
end

local vocations = {
["!sorcerer"] = 1,
["!druid"] = 2,
["!paladin"] = 3,
["!knight"] = 4,
}

local newVoc = vocations[words]
if newVoc then
doPlayerSetVocation(cid, newVoc)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! You are now a " .. getVocationInfo(newVoc).name .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid vocation. Use !sorcerer, !druid, !paladin, or !knight.")
end

return true
end

talkactions.xml.
<talkaction words="!sorcerer;!druid;!paladin;!knight" event="script" value="change_vocations.lua"/>

If you have any problem please inform me immediately.
 
Back
Top