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

RevScripts erro to start event comand

Thiagobs

New Member
Joined
Nov 18, 2014
Messages
24
Reaction score
1
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
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()
 
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
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()


I advise you to look for support in the right place, for Canary revscripts it is better to ask for help directly on the OpenTibiaBR discord

For working Castle War you can looking on:

 
Back
Top