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

callback parameter should be a function.dawnport_max_level.lua:

ZIoberZorba

New Member
Joined
Aug 18, 2022
Messages
4
Reaction score
0
Hi, i'm having a problem with an error that appears inmy distro, I am newbie in how to program your otserver. Someone can help me with this error?

Code:
2022-08-18 08:06:37 -  [2022-18-08 08:06:37.174] [error] Lua script error: luaAddEvent
2022-08-18 08:06:37 -  [2022-18-08 08:06:37.174] [error] callback parameter should be a function.
2022-08-18 08:06:37 -  stack traceback:
2022-08-18 08:06:37 -   [C]: in function 'addEvent'
2022-08-18 08:06:37 -   ...ta/scripts/creaturescripts/others/dawnport_max_level.lua:14: in function <...ta/scripts/creaturescripts/others/dawnport_max_level.lua:3>

ta/scripts/creaturescripts/others/dawnport_max_level.lua :

LUA:
local dawnportMaxLevel = CreatureEvent("DawnportMaxLevel")

function dawnportMaxLevel.onAdvance(creature, target)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local town = player:getTown()
    if player:getLevel() == 20 and town and town:getId() == TOWNS_LIST.DAWNPORT then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
            "You have reached the limit level and have to choose your vocation and leave Dawnport.")
        -- Adds the event that teleports the player to the temple in five minutes after reaching level 20
        addEvent(teleportToDawnportTemple, 5 * 60 * 1000, player:getId())
    end
    return true
end

dawnportMaxLevel:register()
 
Back
Top