local FROM_POS = {x=11, y=22, y=33}
local TO_POS = {x=44, y=55, y=66}
---
local relocated = FALSE
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 and relocated == FALSE then
doTransformItem(item.uid, 1946)
doRelocate(FROM_POS, TO_POS)
relocated = TRUE
elseif relocated == TRUE
doPlayerSendCancel(cid, 'Item was already teleported')
else
doTransformItem(item.uid, 1945)
end
end
I'd like to know the actionid or uniqueid of the tile that items will be placed on. Also, the itemid, actionid, or uniqueid of the item that you want teleported to a specific place. Ontop of that, the position of where you want the specific item to be placed, and the position of where you want the other items to be placed.Can someone help me write a script that moves a specific item placed in a spot (not a teleporter) to another spot, and all other items are moved to another location?
function onAddItem(moveitem, tileitem, position)
local NEW_POS = { x = 1, y = 1, z = 1 }
local TRASH_POS = { x = 1, y = 1, z = 1 }
if tileitem.actionid == ACTIONIDOK? then
if moveitem.itemid == 2597 then
doTeleportThing(moveitem.uid, NEW_POS, 0)
else
doTeleportThing(moveitem.uid, TRASH_POS, 0)
end
doSendMagicEffect(position,CONST_ME_MAGIC_BLUE)
end
return TRUE
end
<movevent event="AddItem" tileitem="1" actionid="sameastableactionid" script="additem.lua" />