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

item position

Tarielle

New Member
Joined
Nov 4, 2007
Messages
214
Reaction score
0
Location
Sweden
hi, is it possible to get a item position?
if not how could make a check if there is a item at a certain position? like if I should remove something I'd only want it removed if the really is there.

thanks
 
Example:
PHP:
local itemPosition = {x=123, y=123, z=7, stackpos=1}
local getItem = getThingFromPos(itemPosition)
if getItem.itemid == 1087 then
doRemove....
else
Cancel
end

Stackpos is the position from the item. Example:

0 = Ground
1 = On top the ground
2 = On top from stackpos 1
3 = on Top from stackpos 2
...

Rep :D
 
Here better will be to use getTileItemById(position, itemid), so you don't need to set stackpos.

For example:
Code:
local getItem = getTileItemById({x=123, y=123, z=7}, 1087)
if(getItem .itemid ~= 0) then
	--doRemove?
else
	--Cancel
end
 
Back
Top