Hi, I have an issue that is driving me crazy. It's with this script:
The error console sends is:
And the fragment of compat.lua that defines doCreateTeleport is
I'm using OTX latest version compiled by myself.
Lua:
local config = {
teleportId = 1387,
dias = {
["Saturday"] = {Position(33649, 31261, 11), Position(33647, 31254, 11)}, -- tanjis
["Friday"] = {Position(33558, 31282, 11), Position(33545, 31263, 11)}, -- jaul
["Sunday"] = {Position(33438, 31248, 11), Position(33419, 31255, 11)}, -- obujos
}
}
function onStartup(interval)
local i = config.dias[os.date("%A")]
doCreateTeleport(config.teleportId, i[2], i[1])
end
The error console sends is:
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/gray island/grayIslandBosses.lua:onStartup
data/lib/compat/compat.lua:998: attempt to index local 'item' (a nil value)
stack traceback:
[C]: in function '__index'
data/lib/compat/compat.lua:998: in function 'doCreateTeleport'
data/globalevents/scripts/gray island/grayIslandBosses.lua:17: in function <data/globalevents/scripts/gray island/grayIslandBosses.lua:15>
And the fragment of compat.lua that defines doCreateTeleport is
Lua:
function doCreateTeleport(itemId, destination, position)
local item = Game.createItem(itemId, 1, position)
if not item:isTeleport() then
item:remove()
return false
end
item:setDestination(destination)
return item:getUniqueId()
end
I'm using OTX latest version compiled by myself.