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

method "isItem" bug

Svira

Intermediate OT User
Joined
Jan 27, 2008
Messages
361
Solutions
13
Reaction score
106
I have no idea why he returns this error to me ... can you help me?
TFS 1.2

LUA:
Lua Script Error: [Action Interface]
data/actions/scripts/stat_slot.lua:onUse
data/stats.lua:1244: attempt to call method 'isItem' (a nil value)

1244:
Code:
local itemEx = {
    uid = target:isItem() and target:getUniqueId() or target:getId(),
    itemid = target:isItem() and target:getId() or 0
}
 
I have no idea why he returns this error to me ... can you help me?
TFS 1.2

LUA:
Lua Script Error: [Action Interface]
data/actions/scripts/stat_slot.lua:onUse
data/stats.lua:1244: attempt to call method 'isItem' (a nil value)

1244:
Code:
local itemEx = {
    uid = target:isItem() and target:getUniqueId() or target:getId(),
    itemid = target:isItem() and target:getId() or 0
}
data/lib/compat/compat.lua
and add
LUA:
function isItem(uid) return Item(uid) end
 
Thats not where the error is, the error lies in the script where you have this:

LUA:
local itemEx = {
    uid = target:isItem() and target:getUniqueId() or target:getId(),
    itemid = target:isItem() and target:getId() or 0
}

However, the fuction isItem that you posted is not the one you are looking for.
 
Back
Top