• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua attempt to compare number with table (checking item on position)

waqmaz

Member
Joined
Jun 17, 2015
Messages
203
Reaction score
11
I want to detect if an item is on a position or not. the script (177 line):
Code:
local redFlagPos = {x = 961, y = 1062, z = 7}
local blueFlagPos = {x = 973, y = 1062, z = 7}

local redFlagID = 1435
local blueFlagID = 4990

    if getTileItemById(redFlagPos, redFlagID).uid > 0 then
        doRemoveItem(getTileItemById(redFlagPos, redFlagID).uid)
    elseif getTileItemById(blueFlagPos, blueFlagID) > 0 then
        doRemoveItem(getTileItemById(blueFlagPos, blueFlagID).uid)
    else
        print('Fatal error nr 18!')
    end

The error:
[04/07/2016 16:15:21] [Error - MoveEvents Interface]
[04/07/2016 16:15:21] In a timer event called from:
[04/07/2016 16:15:21] data/movements/scripts/Battleground/battleGround.lua:eek:nStepIn
[04/07/2016 16:15:21] Description:
[04/07/2016 16:15:21] data/movements/scripts/Battleground/battleGround.lua:177: attempt to compare number with table
[04/07/2016 16:15:21] stack traceback:
[04/07/2016 16:15:21] data/movements/scripts/Battleground/battleGround.lua:177: in function <data/movements/scripts/Battleground/battleGround.lua:129>

/edit damn, lol. I miss ".uid". I am siting at this since yesterday and have just discovered it, so sorry. Hope it will be useful for somebody.
 
Back
Top