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

Solved getItemById = nil?! WHY!!

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,452
Solutions
1
Reaction score
626
Location
Estonia
I have done this many times over, but now suddenly it no longer works?!
What i'm doing wrong here?

local test = Tile({x=673, y=592, z=8}):getItemById(11257)
print(Item(test.uid))
print(test.uid)
print(test.itemid)
print(Item(test.itemid))

All the prints give NIL

How do i get the item.uid?? what is on the floor.
i know the item position and itemID.
 
Tell us what you want to do, since you are using the function completely wrong.
 
im trying to have same effect as this this function:
test = getTileItemById({x=673, y=592, z=8}, 11257)
Both give userdata
But in some reason. i can't use post1 userdata to get item uid.
 
You should verify whether that item is on that tile or not before checking its id and unique id. You cannot access Item userdata with those keys in TFS 1.0 (it got implemented in this commit for 1.1).

Use getId, and getUniqueId.
Code:
local test = Tile(Position(673, 592, 8)):getItemById(11257)
if test then
    print(test:getId(), test:getUniqueId())
end
 
o wow.
Yep
getUniqueId()
was the thing i was looking for :eek:
Didn't even know such thing existed, only used .uid .itemid .actionid so far xD
 
Back
Top