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

TFS 1.X+ Help with script

norrow

Member
Joined
Dec 16, 2012
Messages
129
Reaction score
7
Location
Poland
Lua:
local vocation= {
-- voc/HP/mp
    [17] = {625, 399},
    [18] = {781, 498},
    [91] = {451, 523},
    [96] = {322, 292}
}

function onLogout(player)
    local voc = vocation[player:getVocation():getId()]
    if not voc then
        return true
    end
    
    player:setMaxHealth(player:getMaxHealth() - voc[1])
    player:addHealth(-voc[1])
    player:setMaxHealth(player:getMaxMana() - voc[2])
    player:addMana(-voc[2])
    
    return true
end
hello, could someone tell me why this script doesn't work? there is no error in the console. Tfs 1.4
 
Lua:
local vocation= {
-- voc/HP/mp
    [17] = {625, 399},
    [18] = {781, 498},
    [91] = {451, 523},
    [96] = {322, 292}
}

function onLogout(player)
    local voc = vocation[player:getVocation():getId()]
    if not voc then
        return true
    end
  
    player:setMaxHealth(player:getMaxHealth() - voc[1])
    player:addHealth(-voc[1])
    player:setMaxHealth(player:getMaxMana() - voc[2])
    player:addMana(-voc[2])
  
    return true
end
hello, could someone tell me why this script doesn't work? there is no error in the console. Tfs 1.4
What isn’t working? One problem is setMaxHealth is used twice. The second one should be setMaxMana
 
Back
Top