• 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.7 login.lua

Guralztr

Member
Joined
Dec 4, 2010
Messages
79
Reaction score
12
Hello, does anyone know what this error in TFS 1.7 might be about?


LUA:
on_read: bad method
Admin has logged in.
[Warning - data/creaturescripts/scripts/login.lua] Invoking Creature:getStorageValue will return nil to indicate absence in the future. Please update your scripts accordingly.
[Warning - data/creaturescripts/scripts/login.lua] Invoking Creature:getStorageValue will return nil to indicate absence in the future. Please update your scripts accordingly.

This is login.lua from this TFS


LUA:
function onLogin(player)
    local serverName = configManager.getString(configKeys.SERVER_NAME)
    local loginStr = "Welcome to " .. serverName .. "!"
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. " Please choose your outfit."
        player:sendOutfitWindow()
    else
        player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        loginStr = string.format("Your last visit in %s: %s.", serverName, os.date("%d %b %Y %X", player:getLastLoginSaved()))
    end
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

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

    -- Update client stats
    player:updateClientExpDisplay()
    player:sendHotkeyPreset()
    player:disableLoginMusic()

    -- achievements points for highscores
    if not player:getStorageValue(PlayerStorageKeys.achievementsTotal) then
        player:setStorageValue(PlayerStorageKeys.achievementsTotal, player:getAchievementPoints())
    end

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


Player not login correctly
 
I don't think the warning has anything to do with your login problem. Look for something else. You should be able to ignore the warning without problems.
 
I thought that is part of problem and thats why character not login into game so I will ignore that.

On read bad method could be problem with otclient?
 
@Guralztr What are the issues you are facing exactly? Describe the problem from a user perspective at least, otherwise it will be hard to help you in any meaningful way.
 
LUA:
if value and value == 1 then

Change to

Code:
if value == 1 then

-------------

Code:
 if not player:getStorageValue(PlayerStorageKeys.achievementsTotal) then

Change this to maybe something like

Code:
if player:getStorageValue(PlayerStorageKeys.achievementsTotal) == -1 then
 
I later compiled TFS 1.6, and the warning from login.lua no longer appeared, but there was still an issue with a “bad method” and the player wasn’t logging into the game on the client, even though the console showed “has logged in”.
 
Start from something simpler, download tfs release, from github.
Will be more interesting, and less stressful, and less headaches ; )
And will be better, for more adventures : )
I was the same, as you, probably as many people.
 
Last edited:
Back
Top