• 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 TFS 1.1 Ultimate Item Stat System

xuvurex

New Member
Joined
Mar 23, 2008
Messages
10
Reaction score
0
Hi All,

I have slowly been developing a server in my free time and had decided to add zbizu's ultimate item stats system, but unfortunately upon installation, i am unable to login to my server.

All I have changed is exactly what is outlined in this thread, and have also tried other distro .exe files:
https://otland.net/threads/tfs-1-1-...tem-elements-skills-exp-loot-and-more.229771/

I am getting the following error during login of any characters:
Zrv3vPs.png


Login.lua
Code:
function onLogin(player)
    local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. " Please choose your outfit."
        player:sendOutfitWindow()
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
    end
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    -- Stamina
    nextUseStaminaTime[player.uid] = 0


    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
        if not promotion and value ~= 1 then
            player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
        elseif value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

    -- Events
    player:registerEvent("PlayerDeath")
    player:registerEvent("DropLoot")
    return true
end

Logout.lua
Code:
function onLogout(player)
    local playerId = player:getId()
    if nextUseStaminaTime[playerId] ~= nil then
        nextUseStaminaTime[playerId] = nil
    end
    return true
end

Any help is greatly appreciated!
 
Last edited:
Disable the script e.g. comment it out and login into the game, then systematically enable certain parts of the script to trouble shoot the error, thats how it is done.
 
Disable the script e.g. comment it out and login into the game, then systematically enable certain parts of the script to trouble shoot the error, thats how it is done.

Thank you for your reply Codex NG. I have been working through trouble shooting the script without any success. I have now tried a completely fresh, un-altered distro to start from scratch and for some reason, no matter what I try, the script wont load. I have put the stats.lua in multiple directories in order to try and figure out the issue. Again, any help is appreciated! I have using the stable tfs 1.1 distro.

Global.lua
Code:
dofile('data/lib/lib.lua')
dofile('data/lib/stats.lua')
dofile('data/stats.lua')

for dir in io.popen([[dir "data\lib\" /b /aa]]):lines() do
  dofile('data/lib/'..dir..'')
end

Lib.lua
Code:
-- Core API functions implemented in Lua
dofile('data/lib/core/core.lua')
dofile('data/lib/stats.lua')
dofile('data/lib/core/stats.lua')

-- Compatibility library for our old Lua API
dofile('data/lib/compat/compat.lua')
 
Back
Top