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

Lua Error Console Help

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Lua:
Failure: [Event::loadCallback] scriptInterface ==                              nullptr. scriptid = 4076


The error is due to these scripts, what is wrong?

Lua:
local config = {
    ['Monday'] = 'Alptramun',
    ['Tuesday'] = 'Izcandar_the_Banished',
    ['Friday'] = 'Malofur_Mangrinder',
    ['Thursday'] = 'Maxxenius',
    ['Wednesday'] = 'Malofur_Mangrinder',
    ['Saturday'] = 'Plagueroot',
    ['Sunday'] = 'Izcandar_the_Banished'
}


local spawnByDay = true

local dreamcourts = GlobalEvent("DreamCourts")
function dreamcourts.onStartup()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end

function dreamcourts.onTime()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end

dreamcourts:register()
 
Last edited by a moderator:
Lua:
Failure: [Event::loadCallback] scriptInterface ==                              nullptr. scriptid = 4076


The error is due to these scripts, what is wrong?

Lua:
local config = {
    ['Monday'] = 'Alptramun',
    ['Tuesday'] = 'Izcandar_the_Banished',
    ['Friday'] = 'Malofur_Mangrinder',
    ['Thursday'] = 'Maxxenius',
    ['Wednesday'] = 'Malofur_Mangrinder',
    ['Saturday'] = 'Plagueroot',
    ['Sunday'] = 'Izcandar_the_Banished'
}


local spawnByDay = true

local dreamcourts = GlobalEvent("DreamCourts")
function dreamcourts.onStartup()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end

function dreamcourts.onTime()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end

dreamcourts:register()

Try registering them differently. dreamcourts_startup and dreamcourts_time
 
Try registering them differently. dreamcourts_startup and dreamcourts_time
Lua:
local config = {
    ['Monday'] = 'Alptramun',
    ['Tuesday'] = 'Izcandar_the_Banished',
    ['Friday'] = 'Malofur_Mangrinder',
    ['Thursday'] = 'Maxxenius',
    ['Wednesday'] = 'Malofur_Mangrinder',
    ['Saturday'] = 'Plagueroot',
    ['Sunday'] = 'Maxxenius'
}


local spawnByDay = true

local dreamcourts = GlobalEvent("DreamCourts")
function dreamcourts.onStartup()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end
dreamcourts:register()

i placed it like this and I did not throw an error, do you think something is wrong?
 
Lua:
local config = {
    ['Monday'] = 'Alptramun',
    ['Tuesday'] = 'Izcandar_the_Banished',
    ['Friday'] = 'Malofur_Mangrinder',
    ['Thursday'] = 'Maxxenius',
    ['Wednesday'] = 'Malofur_Mangrinder',
    ['Saturday'] = 'Plagueroot',
    ['Sunday'] = 'Izcandar_the_Banished'
}

local spawnByDay = true

local dreamcourts1 = GlobalEvent("DreamCourts1")
function dreamcourts1.onStartup()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end
dreamcourts1:register()

local dreamcourts2 = GlobalEvent("DreamCourts2")
function dreamcourts2.onTime()
    if spawnByDay then
        print('>> [dream courts] loaded: ' .. config[os.date("%A")])
        Game.loadMap('data/world/worldchanges/dream_courts/' .. config[os.date("%A")] ..'.otbm')
    else
         print('>> dream courts boss: not boss today')
    end
    return true
end
dreamcourts2:time("12:00:00")
dreamcourts2:register()

You cannot register multiple callbacks in a single event, you must create two instances and register their callbacks in each of them
 

Similar threads

Back
Top