• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ I can't display print() in the server log.

gabrielsaintz

New Member
Joined
Jul 19, 2022
Messages
17
Solutions
2
Reaction score
4
GitHub
gabrielsaintz
Logs don't appear as expected in my terminal. When trying to display a log from a Lua script using print(), it doesn't show correctly in my terminal; the log is only displayed when my character logs out.

Example:

This is my talkaction place_monster.lua. I added a print() intending to display it when executing the talkaction, but it doesn't happen as expected.
LUA:
function onSay(player, words, param)

    print("test")

    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    local position = player:getPosition()
    local monster = Game.createMonster(param, position)
    if monster then
        monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        position:sendMagicEffect(CONST_ME_MAGIC_RED)
    else
        player:sendCancelMessage("There is not enough room.")
        position:sendMagicEffect(CONST_ME_POFF)
    end
    return false
end
In the game, I execute the talkaction, and nothing shows in the terminal; it only shows when I log out.

I'm using TFS 1.4.2 release, and my server is inside WSL with Docker.
 
Back
Top