Kedor
New Member
Code:
local oldPos = {x = xxx, y = yyy, z = zz} -- teleport position
local newPos = {x = xxx, y = yyy, z = zz} -- position where the player will be teleported
local itemPos = {x = xxx, y = yyy, z = zz, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} -- position where the item need to be
local itemId = xxxx -- item id (the item that need to disapear)
function onStepIn(cid, item, pos)
local getItem = getThingfromPos(itemPos)
if isPlayer(cid) == TRUE then
if getItem.itemid == itemId then
doSendMagicEffect(oldPos, CONST_ME_POFF)
doTeleportThing(cid, newPos, TRUE)
doSendMagicEffect(newPos, CONST_ME_TELEPORT)
doRemoveItem(getItem.uid)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport isn't activated.")
doSendMagicEffect(oldPos, CONST_ME_POFF)
end
end
return TRUE
end
Master-M: I moved this post to a new thread to help others
Last edited by a moderator: