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?
ta/scripts/creaturescripts/others/dawnport_max_level.lua :
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()