• 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+ script looktype dont working

norrow

Member
Joined
Dec 16, 2012
Messages
129
Reaction score
7
Location
Poland
Hello, i need help with this script, not work, 0 error in console ;c
Lua:
local outfits = {
    [20] = {17},
}

function onLogin(player)
        local voc = player:getVocation():getId()
        if voc > 0 then
            for key in pairs(outfits[voc]) do
                player:addOutfit(outfits[voc + 1])
            end
        end
    return true
end
the script is responsible for the outfit of a given vocation
 
I think you meant setOutfit instead of addOutfit, This should work.

Lua:
local outfits = {
    [20] = {17}
}

function onLogin(player)
    local voc = player:getVocation():getId()
    if outfits[voc] then
        for key, outfit in pairs(outfits[voc]) do
            local playerOutfit = player:getOutfit()
            playerOutfit.lookType = outfit
            player:setOutfit(playerOutfit)
        end
    end
    return true
end
 
Back
Top