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

As per predefined gender for vocation TFS 1.3?

Ninlin

New Member
Joined
Jun 13, 2020
Messages
12
Reaction score
0
Location
Brazil
I want to know how can I make so that vocations have a predefined sex for example Goku male.

TFS 1.3
10.98
znote acc
 
Solution
Should've put this in Requests (https://otland.net/forums/requests.132/)
I would have saw it sooner. xP

Use a login script.

data/creaturescripts/creaturescripts.xml
XML:
<event type="login" name="login_VocationSexChange" script="login_VocationSexChange.lua"/>
data/creaturescripts/scripts/login_VocationSexChange.lua
Lua:
local vocations = {
    [0] = PLAYERSEX_FEMALE,
    [1] = PLAYERSEX_FEMALE,
    [2] = PLAYERSEX_MALE,
    [3] = PLAYERSEX_MALE,
    [4] = PLAYERSEX_MALE -- add all your vocations into this table. data/xml/vocations.xml
}

function onLogin(player)
    local player_voc = player:getVocation():getId()
    if vocations[player_voc] and player:getSex() ~= vocations[player_voc] then
        player:setSex(vocations[player_voc])...
Should've put this in Requests (https://otland.net/forums/requests.132/)
I would have saw it sooner. xP

Use a login script.

data/creaturescripts/creaturescripts.xml
XML:
<event type="login" name="login_VocationSexChange" script="login_VocationSexChange.lua"/>
data/creaturescripts/scripts/login_VocationSexChange.lua
Lua:
local vocations = {
    [0] = PLAYERSEX_FEMALE,
    [1] = PLAYERSEX_FEMALE,
    [2] = PLAYERSEX_MALE,
    [3] = PLAYERSEX_MALE,
    [4] = PLAYERSEX_MALE -- add all your vocations into this table. data/xml/vocations.xml
}

function onLogin(player)
    local player_voc = player:getVocation():getId()
    if vocations[player_voc] and player:getSex() ~= vocations[player_voc] then
        player:setSex(vocations[player_voc])
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your characters sex has been updated to match your vocation.")
    end
    return true
end
 
Solution
Back
Top