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

doTransformItem help!

d4rkbl0od

Member
Joined
Mar 21, 2008
Messages
160
Reaction score
7
when a player is standing over an lever that I want do transform to 1945, i need to use stackpos 2...

doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 2}).uid,1945)

but when there is no one over it, its stackpos 1...
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 1}).uid,1945)

BUT, is there any solution?? because i placed this 2 lines into my script, everytime someones does the action it send error in console ( because it will execute only one of the "doTransformItem" and the other will send an error... anyone mind fixing it for me??

Code:
if items > 0 and item.actionid == 5412 and getGlobalStorageValue(cid, 5410) <= 4 and item.itemid == 1945 then
	if not isCreature(items) and not isPlayer(items) then
			if isMovable(items) or getItemDescriptionsById(getThingFromPos(pos).itemid).type == ITEM_TYPE_MAGICFIELD then
				doRemoveItem(items)
				
				doCreateItem(1026,1,wall)
doCreateItem(1026,1,{x=wall.x+1,y=wall.y,z=wall.z, stackpos=1})
doCreateItem(1026,1,{x=wall.x+2,y=wall.y,z=wall.z, stackpos=1})
setGlobalStorageValue(cid, 5410, 0)
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 2}).uid,1945)
doTransformItem(getThingfromPos({x=32763,y=32291,z=14,stackpos = 1}).uid,1945)
 
Use this : (this will search for the item of id 1946 on whatever stackpos it is and transform it to 1945)

Code:
doTransformItem(getTileItemById( {x=32763,y=32291,z =14},1946 ).uid, 1945)

instead of :
Code:
doTransformItem(getThingfromPos({x=32763,y=32291,z =14,stackpos = 2}).uid,1945)
 
thank you doggy, but can you explain me more about that function? It ignores stackpos? or what? hahaha usefull for my other scripts!! hehe
 
Back
Top