Hello, I don't understand the error shown in the terminal, can someone help me, this error is displayed when starting the command within the game
castle_war_globalevent.lua
C++:
scriptInterface: [Scripts Interface]
scriptId: [/root/canary/data-otservbr-global/scripts/custom/castle_war/castle_war_globalevent.lua:callback]
timerEvent: []
callbackId:[]
function: []
error [...bal/scripts/custom/castle_war/castle_war_globalevent.lua:39: attempt to index global 'woe' (a nil value)
stack traceback:
[C]: in function '__index'
...bal/scripts/custom/castle_war/castle_war_globalevent.lua:39: in function <...bal/scripts/custom/castle_war/castle_war_globalevent.lua:30>]
castle_war_globalevent.lua
Lua:
local TELEPORT_POSITION = Position(32360, 32239, 7)
local TELEPORT_ACTIONID = 38135
local TELEPORT_ITEMID = 1949
local function removeTeleport()
local teleport = Tile(TELEPORT_POSITION):getItemById(TELEPORT_ITEMID)
if teleport then
teleport:remove()
else
error("There is no teleport.")
end
end
local CastleWarOn = GlobalEvent("CastleWarOn")
function CastleWarOn.onThink(interval)
local teleport = Game.createItem(TELEPORT_ITEMID, 1, TELEPORT_POSITION)
if teleport then
teleport:setActionId(TELEPORT_ACTIONID)
else
error("Error to create the teleport.")
end
addEvent(removeTeleport, 60 * 60 * 1000)
Castle:load()
return true
end
CastleWarOn:time("21:40:00")
CastleWarOn:register()
local castlewartalk = TalkAction("!woe")
function castlewartalk.onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
woe.queueEvent(woe.timeDelay+1)
return false
end
castlewartalk:register()