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

TFS 0.X Getting this error in console

mRefaat

Marketing and Coding
Joined
Jan 18, 2014
Messages
854
Solutions
3
Reaction score
141
Location
Egypt
Hello,
as the title say, I am getting this error


Code:
[20:6:16.920] [Error - Action Interface]
[20:6:16.920] data/actions/scripts/other/teleport.lua:onUse
[20:6:16.935] Description:
[20:6:16.935] (LuaInterface::luaDoTileQueryAdd) Tile not found

this is my teleport.lua
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end
 
    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if(doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end
 
    if(not check and doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end
 
    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end
 
    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end

TFS 0.3.7 rev 5969
 
Try this one
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end
 
    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end
 
    if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end
 
    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end
 
    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
 
Try this one
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end

    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end

    if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end

    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end

    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
when someone use a stairs
Code:
[22:54:42.509] [Error - Action Interface]
[22:54:42.509] data/actions/scripts/other/teleport.lua:onUse
[22:54:42.509] Description:
[22:54:42.524] attempt to index a number value
[22:54:42.524] stack traceback:
[22:54:42.524]  [C]: in function 'doTileQueryAdd'
[22:54:42.524]  data/actions/scripts/other/teleport.lua:15: in function <data/actions/scripts/other/teleport.lua:5>
 
Try this one
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end
 
    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if not(doTileQueryAdd(uid, fromPosition) == 1) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end
 
    if(not check and not (doTileQueryAdd(uid, fromPosition) == 1)) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end
 
    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end
 
    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
You copied this script from other server version? Because doTileQueryAdd works in a different way in your server.
 
if not(doTileQueryAdd(uid, fromPosition) == 1) then

I don't think uid is going to work there. Maybe item.uid or something like that. Change everywhere it is just uid. I think anyway.
 
Try this one
Lua:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end

    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if not(doTileQueryAdd(uid, fromPosition) == 1) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end

    if(not check and not (doTileQueryAdd(uid, fromPosition) == 1)) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end

    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end

    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
You copied this script from other server version? Because doTileQueryAdd works in a different way in your server.
No I didn't copy it.

[23:35:40.343] [Error - Action Interface]
[23:35:40.359] data/actions/scripts/other/teleport.lua:eek:nUse
[23:35:40.359] Description:
[23:35:40.359] (LuaInterface::luaDoTileQueryAdd) Thing not found
 
Neither of you are correct.

Change line 14
from this
Lua:
fromPosition.y = fromPosition.y + 1
to this
Lua:
fromPosition.y = fromPosition.y - 1
 
This didn't fix the problem.
Then you didn't change the script properly.
Your error literally states that it can't find the tile, because the position you're checking the tile on is incorrect.
 
Solution
Then you didn't change the script properly.
Your error literally states that it can't find the tile, because the position you're checking the tile on is incorrect.
Yeah, i didn't know when or how it comes. I just saw it on console so i asked why this happens.
There is a sewer grate in map no take to any place where error comes from it.
Thanks :)
 
Back
Top