• 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 Script Error: [Test Interface]

bravespiritz

Member
Joined
Aug 10, 2023
Messages
33
Reaction score
5
This is the error I get, I dont really know how to fix it im using TFS 1.4.2. it is supposed to be a quest that starts when a player enters a portal,

Lua Script Error: [Test Interface]
data/actions/scripts/questPortal.lua
data/actions/scripts/questPortal.lua:69: attempt to index a nil value
stack traceback:
[C]: in function '__index'
data/actions/scripts/questPortal.lua:69: in main chunk
[Warning - Event::checkScript] Can not load script: scripts/questPortal.lua


Lua:
local requiredKills = 15
local completedPlayers = {} -- To track completed players
local spawnPosition = Position(999, 974, 7) -- This is the quest start area
local portalPosition = Position(1000, 988, 6) -- This is the portal's position

local function resetMonsters()
    for _, creature in ipairs(spawnPosition:getCreatures()) do
        creature:remove()
    end
end

local function spawnMonstersForQuest()
    for _ = 1, 2 do
        local rand = math.random(#monsterList)
        local monster = Game.createMonster(monsterList[rand], spawnPosition)
        monster:registerEvent("SpawnRandomMonstersOnDeath")
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1387 and item:getUniqueId() == 1000 and not completedPlayers[player:getName()] then
        print("Player used magic forcefield portal with ID 1387")

        -- Check if the player's position matches the portal's position
        if player:getPosition() == portalPosition then
            print("Player's position matches the portal's position")

            player:teleportTo(Position(999, 974, 7)) -- Teleport to a waiting area
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Quest started! You have 5 minutes to kill 15 monsters.")

            -- Spawn monsters for the quest
            spawnMonstersForQuest()

            local kills = 0
            local timer = 5 * 60 -- 5 minutes in seconds
            local questTimer

            questTimer = function()
                if kills >= requiredKills then
                    completedPlayers[player:getName()] = true
                    player:teleportTo(Position(1000, 1000, 7)) -- Teleport to completion area
                    local rewardItems = {"2457", "2509", "2465", "2478", "2511"}
                    local rewardItem = rewardItems[math.random(#rewardItems)]
                    player:addItem(rewardItem, 1)
                    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! You've completed the quest and received a reward.")
                else
                    if timer > 0 then
                        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Quest progress: " .. kills .. "/" .. requiredKills .. " monsters. Time left: " .. timer .. " seconds.")
                        timer = timer - 1
                        addEvent(questTimer, 1000)
                    else
                        player:teleportTo(Position(1000, 1000, 7)) -- Teleport to failure area
                        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Quest failed! You ran out of time.")
                    end
                end
            end

            addEvent(questTimer, 1000)

        else
            print("Player is not at the correct portal position")
        end
    end
    return true
end

-- Register the onUse function
for _, uniqueId in ipairs({1000}) do
    local portalItem = Tile(portalPosition):getItemById(1387, uniqueId)
    if portalItem then
        portalItem:setActionId(100) -- Replace AID_EXAMPLE with your desired action ID
        portalItem:setAttribute(ITEM_ATTRIBUTE_ACTIONID, 100)
        portalItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, uniqueId)
        portalItem:setAttribute(ITEM_ATTRIBUTE_TEXT, "Use")
    end
end

-- Global event to spawn the portal
local portalSpawnPosition = Position(1000, 988, 6) -- This is where the portal should appear
local portalUniqueId = 1000 -- Replace with the desired unique ID
local portalEvent = GlobalEvent("SpawnQuestPortal")

function portalEvent.onStartup()
    local portalItem = Game.createItem(1387, 1, portalSpawnPosition)
    portalItem:setUniqueId(portalUniqueId)
end

portalEvent:register()
 
Solution
everything works but, the killing message is spamming in the quest area. line 48 in the script.


Lua:
local tileActionId = 45001 -- put this on the tile underneath the portal
local spawnableCreatures = {"rat", "cave rat", "spider", "troll"}
local room = {
    from = Position(994, 973, 7), -- top left corner
    to = Position(1006, 985, 7)  -- bottom right corner
}
local monsters = {}
local killedMonsters = 0
local playerInRoom = 0

local requiredMonster = 15
local questTimer = 300

local teleportOut = Position(1000, 1000, 7)
local teleportIn = Position(1000, 981, 7)

local rewardsItems = {2457, 2509, 2460, 2465, 2478, 2511}

local function spawnMonstersInRoom(amount)
    local spawnPosition
    local randomMonster
    for i = 1...
What you posted is a script for RevScript, not Action.

Just put this script in the "data/scripts/actions" folder of your OT and test it. No need to add an XML file as it will be read automatically since it is a RevScript
 
how do you see it is a rev script?
Well the global event is revscript..
but your action script is not.

You're mixing 2 kinds of scripts together, old and new.

.. ugh it's too many things mixed together to try to explain where it's going wrong.

Maybe it's better if you take a look at my revscript that seems to be similar to what you're trying to do here..


And then you can maybe piece together what would work best for your quest?
 
Well the global event is revscript..
but your action script is not.

You're mixing 2 kinds of scripts together, old and new.

.. ugh it's too many things mixed together to try to explain where it's going wrong.

Maybe it's better if you take a look at my revscript that seems to be similar to what you're trying to do here..


And then you can maybe piece together what would work best for your quest?
thanks for that, I had a question if you want to debug your script how do you go about doing it?
 
thanks for that, I had a question if you want to debug your script how do you go about doing it?
It's mostly just using print throughout your code to check where things are breaking.

So you use them strategically in/out of if statements, for example
Lua:
if someCondition then
    print("Condition met!")
    -- rest of your code
else
    print("Condition not met!")
end
Or if you're not sure why some value is doing something wrong, you can print those directly
Lua:
local x = 10
x = x + 5
print("Value of x:", x)  -- should display "Value of x: 15"
Or if you're working a function, can print inside the function, to ensure it's being triggered and what it's returning as a value
Lua:
function add(a, b)
    print("Function add called with:", a, b)
    local result = a + b
    print("Returning:", result)
    return result
end
Lot's of time you'll want to add them inside of your loops, to check when the loop breaks
Lua:
for i = 1, 5 do
    print("Iteration number:", i)
    -- rest of your loop code
end

And once you've figured out the bugs/inaccuracies, remove the prints from the code. 🤷‍♂️
 
i mean where does this print message show? the server console? I have tried I few times and sometimes I dont get anything from the print
Post automatically merged:

It's mostly just using print throughout your code to check where things are breaking.

So you use them strategically in/out of if statements, for example
Lua:
if someCondition then
    print("Condition met!")
    -- rest of your code
else
    print("Condition not met!")
end
Or if you're not sure why some value is doing something wrong, you can print those directly
Lua:
local x = 10
x = x + 5
print("Value of x:", x)  -- should display "Value of x: 15"
Or if you're working a function, can print inside the function, to ensure it's being triggered and what it's returning as a value
Lua:
function add(a, b)
    print("Function add called with:", a, b)
    local result = a + b
    print("Returning:", result)
    return result
end
Lot's of time you'll want to add them inside of your loops, to check when the loop breaks
Lua:
for i = 1, 5 do
    print("Iteration number:", i)
    -- rest of your loop code
end

And once you've figured out the bugs/inaccuracies, remove the prints from the code. 🤷‍♂️
when I set a print inside of a function nothing happens
 
Last edited:
i mean where does this print message show? the server console? I have tried I few times and sometimes I dont get anything from the print
Post automatically merged:


when I set a print inside of a function nothing happens
The print goes to your console.
Nothing will happen in-game.

If the print is inside a function, and it's not printing, that means the function is not being triggered.
Now you know the issue, and can backtrack from there.

Why is the function not triggering?
 
i mean where does this print message show? the server console? I have tried I few times and sometimes I dont get anything from the print
Post automatically merged:


when I set a print inside of a function nothing happens
If you have a print, and the print never occurs, it could be a few things, such as the conditions before the print were not met (i.e inside an if statement that is never executed),

or you are printing a variable and you made a mistake assigning a value to the variable, and the value of the variable returns nil, you can test it by saying:
Lua:
print(x or "nil")
if you just printed the variable, it may not print anything in the console if nil, which could mislead you and make you think the print never occured.

Also, if you have a bunch of nested if statements, or guard clauses, it's sometimes good to print values inbetween each to figure out where it's breaking:
Lua:
if a then
    print("a")
    if b then
        print("b")
        if c then
            print("c")
        end
    end
end
Lua:
print("a")
if not a then
    return
end

print("b")
if not b then
    return
end

print("c")
if not c then
    return
end
 
Last edited:
If you have a print, and the print never occurs, it could be a few things, such as the conditions before the print were not met (i.e inside an if statement that is never executed),

or you are printing a variable and you made a mistake assigning a value to the variable, and the value of the variable returns nil, you can test it by saying:
Lua:
print(x or "nil")
if you just printed the variable, it may not print anything in the console if nil, which could mislead you and make you think the print never occured.

Also, if you have a bunch of nested if statements, or guard clauses, it's sometimes good to print values inbetween each to figure out where it's breaking:
Lua:
if a then
    print("a")
    if b then
        print("b")
        if c then
            print("c")
        end
    end
end
Lua:
print("a")
if not a then
    return
end

print("b")
if not b then
    return
end

print("c")
if not c then
    return
end
The print goes to your console.
Nothing will happen in-game.

If the print is inside a function, and it's not printing, that means the function is not being triggered.
Now you know the issue, and can backtrack from there.

Why is the function not triggering?
I also got this error, what is compat.lua

Lua Script Error: [Scripts Interface]
C:\Users\hamra\Desktop\tfs-v1.4.2-windows-vcpkg\forgottenserver-1.4.2\data\scripts\creaturescripts\questPortal.lua
data/lib/compat/compat.lua:92: bad argument #1 to 'rawset' (table expected, got userdata)
stack traceback:
[C]: at 0x7ff6d2409730
[C]: in function 'rawset'
data/lib/compat/compat.lua:92: in function '__newindex'
 
I also got this error, what is compat.lua

Lua Script Error: [Scripts Interface]
C:\Users\hamra\Desktop\tfs-v1.4.2-windows-vcpkg\forgottenserver-1.4.2\data\scripts\creaturescripts\questPortal.lua
data/lib/compat/compat.lua:92: bad argument #1 to 'rawset' (table expected, got userdata)
stack traceback:
[C]: at 0x7ff6d2409730
[C]: in function 'rawset'
data/lib/compat/compat.lua:92: in function '__newindex'
compat.lua is there to convert older scripting style to newer scripting style in the background.
TFS 0.4 and below is older scripting style.
TFS 1.0 and above is newer scripting style.

This makes the transition to TFS 1.0+ easier for developers, but should ultimately convert all of the old functions to newer functions.

An example of both styles.
Lua:
doPlayerAddItem(cid, itemId, amount) -- old scripting style
player:addItem(itemId, amount) -- new scripting style
 
i have seen that different action/unique ids do different things, is there a list somewhere to know what action/unique id to use?
compat.lua is there to convert older scripting style to newer scripting style in the background.
TFS 0.4 and below is older scripting style.
TFS 1.0 and above is newer scripting style.

This makes the transition to TFS 1.0+ easier for developers, but should ultimately convert all of the old functions to newer functions.

An example of both styles.
Lua:
doPlayerAddItem(cid, itemId, amount) -- old scripting style
player:addItem(itemId, amount) -- new scripting style
 
i have seen that different action/unique ids do different things, is there a list somewhere to know what action/unique id to use?
Generally these are set by yourself, and you just need to keep track of them, to know if they've been used before or not.
Same with storage values.

There might be a few actionId's automatically setup.. such as in the shovel script..
But there isn't many such scenario's, and are almost exclusively all below 2000.

--
To give a better answer, you'd have to explain what you're trying to achieve.
Post automatically merged:

Ah sorry, there actually is a designated spot for the default one's.

data/lib/core/actionids.lua
 
Last edited:
Generally these are set by yourself, and you just need to keep track of them, to know if they've been used before or not.
Same with storage values.

There might be a few actionId's automatically setup.. such as in the shovel script..
But there isn't many such scenario's, and are almost exclusively all below 2000.

--
To give a better answer, you'd have to explain what you're trying to achieve.
Post automatically merged:

Ah sorry, there actually is a designated spot for the default one's.

data/lib/core/actionids.lua
I dont know if it is complex or not, here is what im trying to accomplish, here goes.

I have a portal id 1387.
  • when player enters the portal, the quest is started
  • and creatures in this array should spawn [rat, cave rat, spider, troll]
  • when a monster dies two more should spawn form the monster list we have
  • a player should survive for 5 min and the player needs to kill 15 monsters. both conditions needs to be met.
  • if the players fails, he is then teleported to (1000, 1000, 7)
  • if he succeeds, he will be teleported to (1000, 1000, 7) and get a random item in his bag from this array [2457, 2509, 2460, 2465, 2478, 2511] -all these item id from RME.
-the monsters should be reset when someone enters the portal.
-1player should only be able to enter the portal at a time.
-if someone dies or is teleported out, the portal should recognize that.

I need someone to put me in the right direction.
 
I dont know if it is complex or not, here is what im trying to accomplish, here goes.

I have a portal id 1387.
  • when player enters the portal, the quest is started
  • and creatures in this array should spawn [rat, cave rat, spider, troll]
  • when a monster dies two more should spawn form the monster list we have
  • a player should survive for 5 min and the player needs to kill 15 monsters. both conditions needs to be met.
  • if the players fails, he is then teleported to (1000, 1000, 7)
  • if he succeeds, he will be teleported to (1000, 1000, 7) and get a random item in his bag from this array [2457, 2509, 2460, 2465, 2478, 2511] -all these item id from RME.
-the monsters should be reset when someone enters the portal.
-1player should only be able to enter the portal at a time.
-if someone dies or is teleported out, the portal should recognize that.

I need someone to put me in the right direction.
Give me like 30 minutes.
I'm going to make a video about how you go about making complex scripts like this.
Post automatically merged:


(edit, after video ended I added to script monsters = {} -- resets the held monsters)
Put in data/scripts
Lua:
local tileActionId = 45001 -- put this on the tile underneath the portal
local spawnableCreatures = {"rat", "cave rat", "spider", "troll"}
local room = {
    from = Position(990, 990, 7), -- top left corner
    to = Position(1010, 1010, 7)  -- bottom right corner
}
local monsters = {}
local killedMonsters = 0
local playerInRoom = 0

local requiredMonster = 15
local questTimer = 300

local teleportOut = Position(1000, 1000, 7)
local teleportIn = Position(1000, 1000, 7)

local rewardsItems = {2457, 2509, 2460, 2465, 2478, 2511}

local function spawnMonstersInRoom(amount)
    local spawnPosition
    local randomMonster
    for i = 1, amount do
        randomMonster = spawnableCreatures[math.random(#spawnableCreatures)]
        spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
        local monster = Game.createMonster(randomMonster, spawnPosition)
        while not monster then
            spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
            monster = Game.createMonster(randomMonster, spawnPosition)
        end
        monsters[#monsters + 1] = {monsterId = monster:getId()}
        monster:registerEvent("onDeathSpawnTwoMore")
    end
end

local function monitorRoom(playerId, timer)
    local player = Player(playerId)
    if not player then
        -- player is no longer online.
        return
    end
    if not player:getPosition():isInRange(room.from, room.to) then
        -- player is no longer in the room
        return
    end
    if killedMonsters >= requiredMonster then
        -- quest success
        player:teleportTo(teleportOut)
        local rand = math.random(#rewardsItems)
        player:addItem(rewardsItems[rand], 1, true)
        return true
    end
    if timer > questTimer then
        -- quest fail
        player:teleportTo(teleportOut)
        return true
    end
    -- continue monitoring event as not finished yet
    addEvent(monitorRoom, 1000, playerId, timer + 1)
end

local moveevent = MoveEvent()

function moveevent.onStepIn(creature, item, position, fromPosition)
 
    -- check if player stepping on the tile
    local player = Player(creature:getId())
    if not player then
        return true
    end
 
    -- check if another player is currently in the room
    local _playerInRoom = Player(playerInRoom)
    if _playerInRoom and _playerInRoom:getPosition():isInRange(room.from, room.to) then
        player:teleportTo(fromPosition, true)
        return true
    end
 
    -- remove all creatures that were previously spawned.
    for i = 1, #monsters do
        local monster = Creature(monsters[i].monsterId)
        if monster then
            monster:remove()
        end
    end
    monsters = {} -- resets the held monsters

    -- get player into the room and start monitoring room
    killedMonsters = 0
    playerInRoom = player:getId()
    player:teleportTo(teleportIn)
    monitorRoom(playerInRoom, 0)
 
    -- spawn new creatures into the room
    addEvent(spawnMonstersInRoom, 2000, #spawnableCreatures)
    return true
end

moveevent:aid(tileActionId)
moveevent:register()



local creatureevent = CreatureEvent("onDeathSpawnTwoMore")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    killedMonsters = killedMonsters + 1
    spawnMonstersInRoom(2)
    return true
end

creatureevent:register()
 
Last edited:
Give me like 30 minutes.
I'm going to make a video about how you go about making complex scripts like this.
Post automatically merged:


(edit, after video ended I added to script monsters = {} -- resets the held monsters)
Put in data/scripts
Lua:
local tileActionId = 45001 -- put this on the tile underneath the portal
local spawnableCreatures = {"rat", "cave rat", "spider", "troll"}
local room = {
    from = Position(990, 990, 7), -- top left corner
    to = Position(1010, 1010, 7)  -- bottom right corner
}
local monsters = {}
local killedMonsters = 0
local playerInRoom = 0

local requiredMonster = 15
local questTimer = 300

local teleportOut = Position(1000, 1000, 7)
local teleportIn = Position(1000, 1000, 7)

local rewardsItems = {2457, 2509, 2460, 2465, 2478, 2511}

local function spawnMonstersInRoom(amount)
    local spawnPosition
    for i = 1, amount do
        spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
        local monster = Game.createMonster(spawnableCreatures[i], spawnPosition)
        while not monster then
            spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
            monster = Game.createMonster(spawnableCreatures[i], spawnPosition)
        end
        monsters[#monsters + 1] = {monsterId = monster:getId()}
        monster:registerEvent("onDeathSpawnTwoMore")
    end
end

local function monitorRoom(playerId, timer)
    local player = Player(playerId)
    if not player then
        -- player is no longer online.
        return
    end
    if not player:getPosition():isInRange(room.from, room.to) then
        -- player is no longer in the room
        return
    end
    if killedMonsters >= requiredMonster then
        -- quest success
        player:teleportTo(teleportOut)
        local rand = math.random(#rewardsItems)
        player:addItem(rewardsItems[rand], 1, true)
        return true
    end
    if timer > questTimer then
        -- quest fail
        player:teleportTo(teleportOut)
        return true
    end
    -- continue monitoring event as not finished yet
    addEvent(monitorRoom, 1000, timer + 1)
end

local moveevent = MoveEvent()

function moveevent.onStepIn(creature, item, position, fromPosition)
 
    -- check if player stepping on the tile
    local player = Player(creature:getId())
    if not player then
        return true
    end
 
    -- check if another player is currently in the room
    local _playerInRoom = Player(playerInRoom)
    if _playerInRoom and _playerInRoom:getPosition():isInRange(room.from, room.to) then
        player:teleportTo(fromPosition, true)
        return true
    end
 
    -- remove all creatures that were previously spawned.
    for i = 1, #monsters do
        local monster = Creature(monsters.monsterId)
        if monster then
            monster:remove()
        end
    end
    monsters = {} -- resets the held monsters

    -- get player into the room and start monitoring room
    killedMonsters = 0
    playerInRoom = player:getId()
    player:teleportTo(teleportIn)
    monitorRoom(playerInRoom, 0)
 
    -- spawn new creatures into the room
    addEvent(spawnMonstersInRoom, 2000, #spawnableCreatures)
    return true
end

moveevent:aid(tileActionId)
moveevent:register()



local creatureevent = CreatureEvent("onDeathSpawnTwoMore")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    killedMonsters = killedMonsters + 1
    spawnMonstersInRoom(2)
    return true
end

creatureevent:register()
thank you for this much appreciated. One thing though I tried the script you wrote. the teleporting part and monster spawning works, but after 5 min im not sent to (1000, 1000, 7). it is just rat fest haha,

and also it spawned a rotworm which was not in the spawnable list.
for making the spawned monsters when a monster is killed from list more random do I use math random?


I will watch your video thanks helping me :)
1692283400658.png
 
thank you for this much appreciated. One thing though I tried the script you wrote. the teleporting part and monster spawning works, but after 5 min im not sent to (1000, 1000, 7). it is just rat fest haha,

and also it spawned a rotworm which was not in the spawnable list.
for making the spawned monsters when a monster is killed from list more random do I use math random?


I will watch your video thanks helping me :)
View attachment 77626
The rotworm definitely wasn't from our script o;

to make them random, yeah missed that.

change to this
Lua:
local function spawnMonstersInRoom(amount)
    local spawnPosition
    local randomMonster
    for i = 1, amount do
        randomMonster = spawnableCreatures[math.random(#spawnableCreatures)]
        spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
        local monster = Game.createMonster(randomMonster, spawnPosition)
        while not monster then
            spawnPosition = Position(math.random(room.from.x, room.to.x), math.random(room.from.y, room.to.y), math.random(room.from.z, room.to.z))
            monster = Game.createMonster(randomMonster, spawnPosition)
        end
        monsters[#monsters + 1] = {monsterId = monster:getId()}
        monster:registerEvent("onDeathSpawnTwoMore")
    end
end

and it should work..
if killedMonsters >= requiredMonster then

This is supposed to ensure that it ends properly..

This is where prints start to come in handy!

so use this, and check console to find out where it's breaking.

Lua:
local function monitorRoom(playerId, timer)
    local player = Player(playerId)
    if not player then
        -- player is no longer online.
        print("player cannot be found. stopping the monitoring.")
        return
    end
    if not player:getPosition():isInRange(room.from, room.to) then
        -- player is no longer in the room
        print("player is no longer in the room. stopping the monitoring.")
        return
    end
    if killedMonsters >= requiredMonster then
        print("player finished killing enough monsters. teleport, giving item, stopping the monitoring.")
        -- quest success
        player:teleportTo(teleportOut)
        local rand = math.random(#rewardsItems)
        player:addItem(rewardsItems[rand], 1, true)
        return true
    end
    if timer > questTimer then
        print("player spent too long in the event. teleporting, stopping the monitoring.")
        -- quest fail
        player:teleportTo(teleportOut)
        return true
    end
    -- continue monitoring event as not finished yet
    print("continuing to monitor the event.")
    addEvent(monitorRoom, 1000, timer + 1)
end
 
one questions when you write this
from = Position(990, 990, 7), -- top left corner
to = Position(1010, 1010, 7) -- bottom right corner


does it see it as a square then? or why top corner and bottom corner?
 
one questions when you write this
from = Position(990, 990, 7), -- top left corner
to = Position(1010, 1010, 7) -- bottom right corner


does it see it as a square then? or why top corner and bottom corner?
Yes, this is a rectangle.

well, technically a rectangular prism, if you're checking more then 1 floor in z position.
 
This was the error after print test
"
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
...erver-1.4.2\data\scripts\creaturescripts\questPortal.lua:55: attempt to compare number with nil
stack traceback:
[C]: in function '__lt'
...erver-1.4.2\data\scripts\creaturescripts\questPortal.lua:55: in function <...erver-1.4.2\data\scripts\creaturescripts\questPortal.lua:35>"

which is
local function monitorRoom(playerId, timer) (35)
if timer > questTimer then (55)
Yes, this is a rectangle.

well, technically a rectangular prism, if you're checking more then 1 floor in z position.
Could you ad more coordianates to represent other shapes on the room?
 
Back
Top